Creation of constants
Creation of constants
- Subject: Creation of constants
- From: j o a r <email@hidden>
- Date: Fri, 31 Oct 2003 10:35:11 +0100
According to Apple you should avoid using the #define preprocessor
command to create constants:
<file:///Developer/Documentation/Cocoa/Conceptual/CodingGuidelines/
Articles/NamingIvarsAndTypes.html>
Why is that? And if that is true, then how would you create string
constants to use for example as dictionary keys - they're only
mentioning integer and floating point constants.
I usually do something like this:
#define MY_KEY @"MyKey"
Should it be:
const id kMyKey = @"MyKey";
?
j o a r
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.