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
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 mails | Author | Date |
|---|---|---|
| Davide Scheriani | Feb 11, 14:28 | |
| Mike Abdullah | Feb 11, 14:59 | |
| Davide Scheriani | Feb 11, 16:51 | |
| Mike Abdullah | Feb 16, 16:14 | |
| Hans van der Meer | Feb 16, 18:34 | |
| mmalc crawford | Feb 17, 03:25 | |
| Hans van der Meer | Feb 18, 10:26 | |
| Mike Abdullah | Feb 18, 11:35 | |
| Davide Scheriani | Feb 18, 12:01 | |
| Hans van der Meer | Feb 18, 21:18 | |
| mmalc crawford | Feb 18, 21:24 | |
| mmalc crawford | Feb 18, 21:28 |






Cocoa mail archive

