• 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
Re: Core Data: rules for custom managed object setter implementations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data: rules for custom managed object setter implementations


  • Subject: Re: Core Data: rules for custom managed object setter implementations
  • From: Jerry Krinock <email@hidden>
  • Date: Fri, 20 Nov 2009 18:48:09 -0800

Well, maybe if I give a wrong answer at least we'll get a discussion started.

On 2009 Nov 20, at 08:32, Sean McBride wrote:

> If I implement a custom setter for an NSManagedObject attribute, what
> can I do?

I do lots of stuff -- in particular, sending notifications to implement business logic -- invoking other setters.  For example, one of my objects has a 'lastModified' date attribute which gets set via such a notification when certain other attributes are changed.

> can't I do?

Try not to do anything which starts an infinite loop ;)

> For example, can I do nothing if the old and new values are the same?

I have considered doing that but can't find any such examples right now.  (Regarding my 'lastModified' attribute, my notification receiver tests for new != old.)

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Core Data: rules for custom managed object setter implementations (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: [iPhone] weird crash (aren't they all?): ivar seems to be dynamically changing its type
  • Next by Date: 2 Problems with setAnimationTransition
  • Previous by thread: Core Data: rules for custom managed object setter implementations
  • Next by thread: question about informal protocols
  • Index(es):
    • Date
    • Thread