Am new to IOS development and am stuck with the below issue, please help.
I want to execute the callback function which prints "hello world" once the showmessage function is done with its job
[msgObj showMessage:@"hai how are you" autoClose:YES type:@"success" onCompletion:^(NSDictionary *str) {
NSLog(@"hello world");
}];
the below two methods exists under different file
-(void)showMessage:(NSString *)msg autoClose:(BOOL)close type:(NSString *)messageType onCompletion:(messageCompletionHandler) complete{
[NSTimer scheduledTimerWithTimeInterval:3.0
target:self
selector:@selector(hideMessageinternal:)
userInfo:complete
repeats:NO];
}
Calling
-(void)hideMessageinternal:(void (^)(void))complete{
complete(); // this is not calling the callback function to print hello world
}