我正在尝试在didFinishLaunchingWithOptions上定义一个NSString但是我得到了一个预期的标识符错误。我是否将NSString baseURL放在错误的位置?
#import "AppDelegate.h"
NSString* baseURL = nil;
@implementation AppDelegate
@synthesize window = _window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
baseURL = [@"http://mytesturl.com"];
// Override point for customization after application launch.
return YES;
}
答案 0 :(得分:2)
字符串周围不应有括号。尝试:
baseURL = @"http://mytesturl.com";