Re: Binding Tableviews (newbie) problems/questions
Re: Binding Tableviews (newbie) problems/questions
- Subject: Re: Binding Tableviews (newbie) problems/questions
- From: Vince Ackerman <email@hidden>
- Date: Thu, 13 Jan 2005 21:02:34 -0800
Scott,
I added the mutableArrayValueForKey to your addEmail method with the this result:
- (IBAction) addEmail: (id)sender
{
// get current mailbox
int mailboxRow = [mailboxTable selectedRow];
if (mailboxRow < 0) return;
Mailbox * mailbox = [[self mailboxes] objectAtIndex: mailboxRow];
// get mutable array of emails
// and add new instance
NSMutableArray * emails = [mailbox emails];
Email * newEmail = [[Email alloc] init];
[[self mutableArrayValueForKey: @"emails"] addObject: newEmail]; // <------ added/replaced
// reload table and select new item
[emailTable reloadData];
[emailTable selectRow: ([emails count] - 1) byExtendingSelection: NO];
}
When it called the addEmail method it crashed with this message in the log window:
[Session started at 2005-01-13 20:44:55 -0800.]
2005-01-13 20:45:06.086 MailDemo[3357] [<MyController 0x33a460> valueForUndefinedKey:]: this class is not key value coding-compliant for the key emails.
Not understanding what is going on... it's not liking the @"emails" key.
Thanks for looking at this... I guess I could just ditch the bindings and go back with the glue code if I want to modify the arrays behind the controllers back :-(
Thanks in advance
Vince
_______________________________________________
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