FROM : Hans van der Meer
DATE : Sat Feb 16 18:34:42 2008
On 16 feb 2008, at 16:14, Mike Abdullah wrote:
>
> On 11 Feb 2008, at 15:51, Davide Scheriani wrote:
>
>> well,
>> the NSArrayController is bound to an array in MyDocument class file.
>> When I get back my datas from the file I reafill the array and the
>> NSArrayC should update
>> the datas.But I dont see doing this.
>> Ill have a look into the documentation of MVC anw...
>
> Ah, in which case then I suspect you are not refilling the
> document's array in a KVC-compliant manner. Care to post some sample
> code?
>
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"];
Hope this helps.
Hans van der Meer
DATE : Sat Feb 16 18:34:42 2008
On 16 feb 2008, at 16:14, Mike Abdullah wrote:
>
> On 11 Feb 2008, at 15:51, Davide Scheriani wrote:
>
>> well,
>> the NSArrayController is bound to an array in MyDocument class file.
>> When I get back my datas from the file I reafill the array and the
>> NSArrayC should update
>> the datas.But I dont see doing this.
>> Ill have a look into the documentation of MVC anw...
>
> Ah, in which case then I suspect you are not refilling the
> document's array in a KVC-compliant manner. Care to post some sample
> code?
>
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"];
Hope this helps.
Hans van der Meer
| 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

