How do I wrap a BOOL
in an object type in Objective-C?
I want to store a BOOL
in the userInfo
object of an NSTimer
. How do I wrap it?
NSNumber *boolForUserInfo = @YES; // or [NSNumber numberWithBool:YES] the old way
[userInfo setObject:boolForUserInfo forKey:@"myBool"];
Retrieve with:
[[userInfo objectForKey:@"myBool"] boolValue];