#import "OPTextBlock.h"
@interface OPTextBlock()
@property (nonatomic, copy) void (^block)(void) ;
@property(nonatomic,copy)void(^textObjcblock)(OPTextBlock*textObjc) ;
@property (nonatomic, copy) NSString * name;
@end
@implementation OPTextBlock
-(void)textblock
{
__weak __typeof(self) weakself =self;
self.block= ^{
__strong__typeof(weakself) strongself = weakself;
strongself.name=@"张三";
};
self.block();
}
-(void)textblock1
{
__blockOPTextBlock*textObjc =self;
self.block= ^{
textObjc.name=@"张三";
textObjc =nil;
};
self.block();
}
-(void)textblock2
{
self.textObjcblock = ^(OPTextBlock *textObjc){
textObjc.name=@"张三";
};
self.textObjcblock(self);
}