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