@interface UILabel (Chainable)
@property (nonatomic, readonly) UILabel *(^color)(NSString *value);
@end
@implementation UILabel (Chainable)
- (UILabel *(^)(NSString *value))color {
return ^(NSString *value) {
self.textColor = UIColor.whiteColor; //
return self;
};
}
@end
UILabel *label = [UILabel new].color(@"0xffffff");
Why coding like this cause crash:
Thread 1: EXCBADACCESS (code=1, address=0x0) when xcode -> edit scheme -> Diagnostics -> main thread checker is selected
Only crash when using debug mode.