• 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
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]

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


  • Subject: Always use the constants (was Re: Finding all deleted objects from Core Data)
  • From: Chris Hanson <email@hidden>
  • Date: Thu, 5 Oct 2006 11:44:53 -0700

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


  • Follow-Ups:
    • Re: Always use the constants (was Re: Finding all deleted objects from Core Data)
      • From: Remco Poelstra <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>)

  • Prev by Date: NSManagedObjectContext Multiple Selection Error
  • Next by Date: FileHandle in Threads
  • Previous by thread: Re: Finding all deleted objects from Core Data
  • Next by thread: Re: Always use the constants (was Re: Finding all deleted objects from Core Data)
  • Index(es):
    • Date
    • Thread