Hello! I have an Objective-C NSMutableDictionary declared inside a class's @interface section, with getter/setter methods, like so:
@interface myClass : NSObject
{
NSMutableDictionary *dict;
}
- (void) setDict: (NSMutableDictionary *) newDict;
- (NSMutableDictionary *) dict;
Inside some of my @implementation methods I want to modify dict. I'd like to stick to standard Obj-C idiom and modify it "properly". Is it OK to modify it like this, using the getter but not the setter:
[[self dict] removeObjectForKey:@"myKey"];
...or is there a better way to do this?