• 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
NSNotification / Core Data roadblock
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: NSNotification / Core Data roadblock
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: Set of controls offered in IB palette
  • Next by Date: Re: Best way to ensure prevent multiplying helper tasks
  • Previous by thread: Re: Grouped NSTableView Cells/Rows
  • Next by thread: Re: NSNotification / Core Data roadblock
  • Index(es):
    • Date
    • Thread