Starting with the
.h file, follow these steps:
1. Delete the import of
2. Change the delegate to
3. Add these block properties:
@property (copy, nonatomic) CDCar* (^carToView)(void); @property (copy, nonatomic) void (^carViewDone)(BOOL dataChanged); @property (copy, nonatomic) void (^nextOrPreviousCar)(BOOL isNext);
One thing to notice is that each block property is marked as
strong. This is very important and is related to how blocks work with external variables. Again, for more information, see Chapter 17 of Learning Objective-C by Robert Clair.
Each of the properties declares a block that replaces the same protocol ...