1.在Xcode5下,获取程序名字(app name)的方法为:
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
NSString *bundleName = [infoDictionary objectForKey:@"CFBundleName"];
或者
NSString *proName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];
2.在Xcode6下,获取程序名字(app name)的方法为:
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
NSString *bundleName = [infoDictionary objectForKey:@"CFBundleName"];
或者
NSString *proName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"];