简单block 和 代理

int (^sunBlock)(int, int) = ^(int a, int b){
        return a + b;
    };
    NSLog(@"%d",sunBlock(7,8));

 

@protocol myDelegate <NSObject>

-(void)test;

@end

@interface ViewController ()
@property (nonatomic,weak) id <myDelegate> delegate;
@end

 

posted @ 2015-02-26 20:02  myFisland  阅读(95)  评论(0编辑  收藏  举报