• 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: Always use the constants (was Re: Finding all deleted objects from Core Data)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Always use the constants (was Re: Finding all deleted objects from Core Data)


  • Subject: Re: Always use the constants (was Re: Finding all deleted objects from Core Data)
  • From: Remco Poelstra <email@hidden>
  • Date: Thu, 5 Oct 2006 21:43:35 +0200

Ah, I see, I didn't even know that that constant was not to be interpreted as being a string.

Thanks both for pointing that out to me!

Remco Poelstra

Op 5-okt-2006, om 20:44 heeft Chris Hanson het volgende geschreven:

On Oct 5, 2006, at 11:37 AM, Diederik Hoogenboom wrote:

The name: part calling the method should be name:NSManagedObjectContextObjectsDidChangeNotification, without the @"".

This is a very good point, and another often-unstated rule of Cocoa development:


Always use a global constant for notification, exception, and other names.

You are not guaranteed that the value of that global will be identical to its name. It could be anything, and it could even -- in theory -- change from release to release. Using the global will insulate you from these changes.

It will also let you do things like command-double-click in Xcode and be taken to the constant's definition so you can see other possible constants and associated information. For example, for a notification, error, or exception name, the header containing the constant declaration also often details what's in the userInfo property of the associated object at runtime.

  -- Chris

_______________________________________________
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

_______________________________________________ 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
References: 
 >Re: Finding all deleted objects from Core Data (From: Remco Poelstra <email@hidden>)
 >Re: Finding all deleted objects from Core Data (From: email@hidden)
 >Re: Finding all deleted objects from Core Data (From: Remco Poelstra <email@hidden>)
 >Re: Finding all deleted objects from Core Data (From: Diederik Hoogenboom <email@hidden>)
 >Always use the constants (was Re: Finding all deleted objects from Core Data) (From: Chris Hanson <email@hidden>)

  • Prev by Date: Putting up a full screen window
  • Next by Date: Re: bindings from threads
  • Previous by thread: Always use the constants (was Re: Finding all deleted objects from Core Data)
  • Next by thread: Re: Finding all deleted objects from Core Data
  • Index(es):
    • Date
    • Thread