I was using a NSMutableArray and realized that using a dictionary is a lot simpler for what I am trying to achieve.
I want to save a key as a NSSt
By setting you'd use setValue:(id)value forKey:(id)key method of NSMutableDictionary object:
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
[dict setValue:[NSNumber numberWithInt:5] forKey:@"age"];
Or in modern Objective-C:
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
dict[@"age"] = @5;
The difference between mutable and "normal" is, well, mutability. I.e. you can alter the contents of NSMutableDictionary (and NSMutableArray) while you can't do that with "normal" NSDictionary and NSArray