Skip navigation.
 
mlRe: Loading saved file into NSArrayController
FROM : mmalc crawford
DATE : Mon Feb 18 21:24:45 2008

On Feb 18, 2008, at 1:26 AM, Hans van der Meer wrote:

>>> It might be of use to remember that changes within an 
>>> NSMutableArray (addObject, remove...) do not by themselves lead 
>>> tot calling the class's observers. I found it useful to bracket 
>>> the changes in this manner:
>>> [self willChangeValueForKey:@"theArray"];
>>> // changes to the contents of the array
>>> [self didChangeValueForKey:@"theArray"];
>>>

>> Don't do this.
>> RTFineM.

>
> Please forgive me my ignorance. But I do not understand why the 
> change bracketing should not be done.


Because it says the whole array has changed, not the specific elements.
It's very inefficient.
For batch operations, see e.g <http://homepage.mac.com/mmalc/CocoaExamples/controllers.html
>

mmalc

Related mailsAuthorDate
mlLoading saved file into NSArrayController Davide Scheriani Feb 11, 14:28
mlRe: Loading saved file into NSArrayController Mike Abdullah Feb 11, 14:59
mlRe: Loading saved file into NSArrayController Davide Scheriani Feb 11, 16:51
mlRe: Loading saved file into NSArrayController Mike Abdullah Feb 16, 16:14
mlRe: Loading saved file into NSArrayController Hans van der Meer Feb 16, 18:34
mlRe: Loading saved file into NSArrayController mmalc crawford Feb 17, 03:25
mlRe: Loading saved file into NSArrayController Hans van der Meer Feb 18, 10:26
mlRe: Loading saved file into NSArrayController Mike Abdullah Feb 18, 11:35
mlRe: Loading saved file into NSArrayController Davide Scheriani Feb 18, 12:01
mlRe: Loading saved file into NSArrayController Hans van der Meer Feb 18, 21:18
mlRe: Loading saved file into NSArrayController mmalc crawford Feb 18, 21:24
mlRe: Loading saved file into NSArrayController mmalc crawford Feb 18, 21:28