Re: ADC Core Data article
Re: ADC Core Data article
- Subject: Re: ADC Core Data article
- From: mmalcolm crawford <email@hidden>
- Date: Fri, 8 Apr 2005 14:13:40 -0700
On Apr 8, 2005, at 12:48 PM, Scott Ellsworth wrote:
If foo has no "blob" accessor, then [foo blob] throws a warning at
compile time, while [foo valueForKey:@"blob"] does not, instead
erroring at runtime.
A strategy *some*(*) EOF developers found useful was to define string
constants for the keys, so instead of valueForKey:@"blob" you would
have:
Class.h
extern NSString *blobKey;
Class.m
NSString *blobKey = @"blob";
then [foo valueForKey:blobKey];
You could also make the key name more specific to a given entity to
avoid namespace collisions etc...
This is purely a tool problem - they could write something to check
valueForKey at runtime, but they have not done so,
I'm not sure what this means?
mmalc
(*) I fully appreciate that some people don't like this style. This
is something about which there will, I suspect, never be consensus.
If you find it useful, please use it. If you don't, please don't use
it. Could we please not have a big discussion about this...?
_______________________________________________
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