• 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: ADC Core Data article
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: ADC Core Data article
      • From: Scott Ellsworth <email@hidden>
References: 
 >Re: ADC Core Data article (From: Philippe Mougin <email@hidden>)
 >Re: ADC Core Data article (From: Shawn Erickson <email@hidden>)
 >Re: ADC Core Data article (From: Charlton Wilbur <email@hidden>)
 >Re: ADC Core Data article (From: Scott Ellsworth <email@hidden>)

  • Prev by Date: Re: Sorting NSStrings in NSTableColumn (need 10 after 9)
  • Next by Date: Re: Sorting NSStrings in NSTableColumn (need 10 after 9)
  • Previous by thread: Re: ADC Core Data article
  • Next by thread: Re: ADC Core Data article
  • Index(es):
    • Date
    • Thread