Global constants in Objective-C
问题 I've a file called Constants.h : extern NSString * const BASE_URL; and Constants.m : #ifdef DEBUG NSString * const BASE_URL = @"http://www.example.org "; #else NSString * const BASE_URL = @"http://localhost"; #endif First question: How can I switch DEBUG to be True and False ? I've a view controller file MyViewController.m : #import "MyViewController.h" #import "Constants.h" // this doesn't works. see above for the error. static NSString * const ANOTHER_URL = [NSString stringWithFormat:@"%@%@