• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Binding and dependant keys
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Binding and dependant keys


  • Subject: Binding and dependant keys
  • From: Frédéric Testuz <email@hidden>
  • Date: Sat, 13 Nov 2004 11:58:25 +0100

Hello,

In an app, I have a Person class

@interface Person : NSObject
{
NSString *firstName;
NSString *lastName;
}
@end;

I have defined the accessor methods. I also defined

+ (void)initialize
{
[self setKeys:[NSArray arrayWithObjects:@"firstName", @"lastName", nil]
triggerChangeNotificationsForDependentKey:@"fullName"];
}

- (NSString *)fullName
{
return [lastName stringByAppendingFormat:@", ", firstName];
}

I have a window with a NSTableView which display the fullName key and two NSTextField to edit firstName and lastName. There is also a button connect to the insert: action of the NSArrayController.

When the window is display, the fullName of all the record is display correctly. But when I push the button to insert a new record, the fullName method is never called for this new record. So the change is never reflect in the table view for this new record only.

Any idea why ? And how I can resolve this ?

--
Frédéric Testuz
<mailto:email@hidden>
_______________________________________________
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


  • Follow-Ups:
    • Re: Binding and dependant keys
      • From: mmalcolm crawford <email@hidden>
    • Re: Binding and dependant keys
      • From: Peter Schmidt <email@hidden>
  • Prev by Date: Re: Controller Method called after apps Nib is loaded
  • Next by Date: Re: Binding and dependant keys
  • Previous by thread: NSDate resolves to midnight of the current day if given the natural language string "now"
  • Next by thread: Re: Binding and dependant keys
  • Index(es):
    • Date
    • Thread