I thought I had a handle on KVO, but in reviewing some old code while
writing some new code, I think I may have been missing a bit. Here are
my questions:
I'm using an NSArrayController to manage an NSArray which contains a
number of NSMutableDictionary's. When I add NSDictionary's to the
NSArray, I use the NSArrayController's addObject: method. If I need to
alter anything in the mutabledictionary, I retrieve a pointer to it
directly from the NSArray, alter it, while wrapping the change with
willChangeValueForKey and didChange...
This seems to work and the NSTableView that uses the NSArrayController
is updated correctly. Question 1: Is this the correct way to do this?
In some of my old code, I had been adding mutabledictionarys directly to
the NSArray, wrapping it with willChange... and didChange... to ensure
the KVO updates. Question 2: Is this the wrong way to do this?
Thanks