Possible Duplicate:
Objective-C dictionary inserting a BOOL
I need to add key-value pair NSIndexPath -> BOOL to NSMutableDictionary.How can I do this? It’s really a problem for me. I can’t use neither setValue forKey (because key must be NSString only) nor setObject forKey (because BOOL is a primitive and I cant’use [NSNumber numberWithBool:YES] also because NSNumber is immutable and I need to change BOOL value).
So the question how can I add such a key-value pair with all the restrictions i have. Any ideas?
Wrap the BOOL in a
NSNumberas suggested in this answer: Objective-C dictionary inserting a BOOL