Created
March 22, 2013 05:01
-
-
Save xuyunan/5219053 to your computer and use it in GitHub Desktop.
创建常量
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Easiest way: | |
// Prefs.h | |
#define PREFS_MY_CONSTANT @"prefs_my_constant" | |
// Better way: | |
// Prefs.h | |
extern NSString * const PREFS_MY_CONSTANT; | |
// Prefs.m | |
NSString * const PREFS_MY_CONSTANT = @"prefs_my_constant"; | |
// from http://stackoverflow.com/questions/538996/constants-in-objective-c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment