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