Re: Binding Tableviews (newbie) problems/questions
Re: Binding Tableviews (newbie) problems/questions
- Subject: Re: Binding Tableviews (newbie) problems/questions
- From: Scott Stevenson <email@hidden>
- Date: Thu, 13 Jan 2005 13:50:54 -0800
On Jan 11, 2005, at 8:28 AM, Vince Ackerman wrote:
but when I disconnect the add: binding (and use the addEmail method in
the controller object) I still don't see the email tableview update
itself. It will finally update when I select any other mailbox or
blank row in the mailbox tableview then select the new mailbox row
again.
I've added the following which doesn't seem to work:
[self willChangeValueForKey:@"emails"];
[emails addObject: newEmail];
[self didChangeValueForKey:@"emails"]
Try this instead:
[[self mutableArrayValueForKey: @"emails"] addObject: newEmail];
Looking at Scott's example, the key @"emails" is the NSMutableArray
that contains the pointer to the mailbox array of the currently
selected row in the mailbox tableview. I'm confused how this pointer
is a "key" and how this will send a notification that I've modified
the mailbox array?
A key is just a name that you ask key-value coding to resolve. If you
ask for "emails", it might be a message that returns an array or an
instance variable. It's determined dynamically.
Sending a notification for the key "emails" only matters if that's what
the NSArrayController is bound to.
Do I have to turn off Automatic KVO notification prior to using this?
Nope.
- Scott
--
http://treehouseideas.com/
http://theocacao.com/ [blog]
_______________________________________________
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