I noticed that when my method runs, nothing is printed to the console:
- (BOOL)theTemporyFunction
{
return YES;
NSLog(@"Events");
}
but when I change the order of the statements:
- (BOOL)theTemporyFunction
{
NSLog(@"Events");
return YES;
}
the NSLog() does run.
Both versions compile, so why doesn’t NSLog() seem to work in the first?
returnis the last statement that is executed in a function. After the return statement the function returns the control to the caller.For example: