[ios]block的使用
声明方法时:- (id)initWithImageURL:(NSString*)imageURL imageLabel:(NSString*)labelName withBlock:(void (^)(void))NNSBItemPressedBlock
其中(void (^)(void))NNSBItemPressedBlock,第一个void是返回类型,第二个void是传入参数类型
调用方法:NNSBItemPressedBlock();
声明变量时:
void (^_pressedBlock)(void) ;
@property void (^pressedBlock)(void);
int (^abc)(int a)=^(int a){
return a;
};
// abc
abc(1);
相关推荐
IOSPanPan 2015-04-15
chermonlove 2019-08-02
tzshlyt 2019-07-01
jscjxysx 2019-07-01
tzshlyt 2019-07-01
Jplane 2019-07-01
lijiexiaoge 2019-06-29
lijiexiaoge 2019-06-27
我的iOS王者之路 2019-06-21
huangxiaoyu 2018-05-04
wsmrcool 2016-08-05
lingluan 2015-04-15
SoccerZZM 2014-06-12
iOSliang 2013-12-16
qianchunqiang 2013-11-28
dahuichen 2013-03-27