I have a class which I want to two optional blocks
so in the class.h:
@property (nonatomic, copy) void (^onConnectBlock)(void);
and in a method inside the class:
I have:
_onConnectBlock();
Unfortunately if this is not set:
[class setOnConnectBlock:^{
[class send:auth];
}];
the app crashes with EXC_BAD_ACCESS
.
I have tried to add an exception block but still returns EXC_BAD_ACCESS
?
@try {
_onCloseBlock();
}
@catch (NSException *exception) {
}