获取appName

+ (NSString*)appName 

{

NSBundle *bundle = [NSBundle bundleForClass:[self class]];

NSString *appName = [bundle objectForInfoDictionaryKey:@"CFBundleDisplayName"];

if (!appName) {

appName = [bundle objectForInfoDictionaryKey:@"CFBundleName"];

}

return appName;

}

你可能感兴趣的:(ios,iPhone开发)