How can I get notifications with NSNotificationCenter when object is added to NSMutableDictionary?
Also are there any notifications for immutable NSDictionary?
The the beauty of inheritance :)
#define kSomeDictionarySetAValue @"SomeDictionarySetAValue"
@interface SomeDictionary : NSMutableDictionary
@end
@implementation SomeDictionary
- (void) setValue:(id)value forKey:(NSString *)key
{
[super setValue:value forKey:key];
[[NSNotificationCenter defaultCenter] postNotificationName:kSomeDictionarySetAValue
object:self];
}
@end