Li Hongqiang iOS Development-use of block
01-Define block
pay block
typedef void(^invokepayblock) (cfbaseordermodel *model);
02-Declare the Block property according to the defined block
@property (copy, nonatomic) invokepayblock payblock;
03-Wire the button off in. h and. M
-(ibaction) Invokepayblockhandler: (ID) sender;
-(ibaction) Invokedelorderblockhandler: (ID) sender;
-(ibaction) Invokereceiptblockhandler: (ID) sender;
-(ibaction) Invokerepurchaseblockhandler: (ID) sender;
-(ibaction) Invokerevaluateblockhandler: (ID) sender;
04-Assigning block to a. m file
-(ibaction) Invokepayblockhandler: (ID) sender
{
self. Payblock(tmpmodel);
}
05-A block that calls the original definition number in the controller and is called in the Blockbutton to implement the function of the method
Footerview. Payblock = ^ (cfbaseordermodel *model)
{
[Weakself Callbackpayhandler: section_];
};
methods that are called in 06-block
Li Hongqiang iOS Development-use of block