app信息實際上就是存儲在項目的Info.plist文件,獲取app信息就是從它中查找,那如今你們都能想到怎麼作了吧app
//獲取info.plist文件 NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; //app名稱 NSString *name = [infoDictionary objectForKey:@"CFBundleDisplayName"]; //app版本 NSString *version = [infoDictionary objectForKey:@"CFBundleShortVersionString"]; //app build版本 NSString *build = [infoDictionary objectForKey:@"CFBundleVersion"]; NSLog(@"name = %@\n version = %@ \n build = %@", name, version, build);