Hi everyone,
I've been noodling around a bit in Objective-C and Xcode, and I've run into some trouble in trying to log output using NSLog.
I get the following:
then a crash, then the following error: Program received signal: "EXC_BAD_ACCESS".
If I change the code so that the string interpolation is using decimals instead, like so:
I get the following.
What's the proper Obj-C/XCode way to get this output:
Thanks!
I've been noodling around a bit in Objective-C and Xcode, and I've run into some trouble in trying to log output using NSLog.
Code:
BOOL yesFlag = YES;
BOOL noFlag = NO;
NSLog(@"This string should end with NO: %@", noFlag);
NSLog(@"This string should end with YES: %@", yesFlag);
I get the following:
Code:
2009-01-29 18:55:08.707 PrintingBooleans[26312:10b] This string should end with NO: (null)
If I change the code so that the string interpolation is using decimals instead, like so:
Code:
BOOL yesFlag = YES;
BOOL noFlag = NO;
NSLog(@"This string should end with NO: %d", noFlag);
NSLog(@"This string should end with YES: %d", yesFlag);
I get the following.
Code:
2009-01-29 18:57:00.065 PrintingBooleans[26331:10b] This string should end with NO: 0
2009-01-29 18:57:00.093 PrintingBooleans[26331:10b] This string should end with YES: 1
What's the proper Obj-C/XCode way to get this output:
Code:
2009-01-29 18:57:00.065 PrintingBooleans[26331:10b] This string should end with NO: NO
2009-01-29 18:57:00.093 PrintingBooleans[26331:10b] This string should end with YES: YES
Thanks!