• 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: KVC and KVO for arrays
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: KVC and KVO for arrays


  • Subject: Re: KVC and KVO for arrays
  • From: Stephen Hoffman <email@hidden>
  • Date: Fri, 15 Feb 2008 10:18:22 -0500
  • Organization: HoffmanLabs LLC


I'm not massively experienced in C, started in FORTRAN and came into
Objective-C this year, can anyone tell me how the two versions differ
and if adopting one over the other will have any effect on my code
later?  Much of the Apple code I've seen use #define statements, but
I've seen the NSString elsewhere like in Hillegass's book.

Jon
It was once fairly common practice to use the C preprocessor (home of the #define and friends) on Fortran source code, then run the results through the Fortran compiler.

Seeing Fortran with C preprocessor and macro definitions embedded was (at first) jarring, but it all works nicely.

I mention this to flag the internal sequencing here.

At its simplest, the preprocessor #define is for use by the programmer on the program source code and for the program source code itself, and prior to compilation, while NSString and C declarations are for run-time and external and display use.

One wrinkle: various debuggers can't deal with and can't symbolize the C preprocessor names, just the resulting substitutions. This again because the pre-processing here takes place upstream from the compilation, and its associated creation of the debug symbol tables. _______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Proper use of #define to aid in compile-time checking of strings (was KVC and KVO for arrays)
      • From: "John Dann" <email@hidden>
  • Prev by Date: Re: Strategies to prevent class name clashes
  • Next by Date: Re: In-loop releasing of objects does not free memory?
  • Previous by thread: Re: KVC and KVO for arrays
  • Next by thread: Proper use of #define to aid in compile-time checking of strings (was KVC and KVO for arrays)
  • Index(es):
    • Date
    • Thread