NSNotification / Core Data roadblock
NSNotification / Core Data roadblock
- Subject: NSNotification / Core Data roadblock
- From: "Paul L. Gribble" <email@hidden>
- Date: Fri, 16 Dec 2005 17:37:51 -0500
I have a core data app that has two entities: a "Trip" entity, and a
relationship to an array of "Transaction" entities.
I want the Trip entity to re-calculate one of its atttributes,
"balance", when an "amount" attribute in any one of the transaction
entities is altered.
I have decided to try to use the NSNotificiationCenter to get this done;
In the setAmount method in the Transaction class I have:
[[NSNotificationCenter defaultCenter]
postNotificationName:@"amountChanged" object:self];
and in the +initialize method of the Trip class I have:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(transactionAmountChanged:)
name:@"amountChanged" object:nil];
But when I run the app I get an error:
*** +[Trip transactionAmountChanged:]: selector not recognized
even though I have in both the header file and the m file for Trip
the method declaration for
- (void)transactionAmountChanged:(NSNotification *)notification
{
NSLog(@"### transactionAmountChanged method activated within Trip");
}
any ideas for a newbie?
Thanks so much
_______________________________________________
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