Re: Basic NSArrayController NSTableView bindings question
Re: Basic NSArrayController NSTableView bindings question
- Subject: Re: Basic NSArrayController NSTableView bindings question
- From: Ron Lue-Sang <email@hidden>
- Date: Tue, 23 Aug 2005 11:22:34 -0700
Adding objects to the array doesn't send a KVO notification saying
your array changed.
[myArray addObjectsFromArray:result];
should be
[self willChangeValueForKey:@"myArray"];
[myArray addObjectsFromArray:result];
[self didChangeValueForKey:@"myArray"];
or
[[self mutableArrayValueForKeyPath:@"myArray"]
addObjectsFromArray:result];
The mutable array you get from this second option DOES send a KVO
notification when it is changed. For cases like this, where the class
that owns the ivar is making the change, I prefer option 1.
-----------------------------
Ronzilla
Core Bindings/Cocoa Data
On Aug 23, 2005, at 5:43 AM, email@hidden wrote:
Nothing appears in my table when I run my program, although I know
there is content in the array. I get nothing in the log. My program
fills the array with
[myArray addObjectsFromArray:result];
where result is an array of MyClass object instances.
Do I have to create accessors in order to use bindings for this? Is
so, what accessors are needed and for what class?
--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden