在这里,我粘贴我的代码,我想从我的test-Info.plist中检索Bundle版本。如何从iPhone中的项目test-Info.plist中检索标签中的Bundle版本?
@interface testViewController : UIViewController {
UILabel *label;
}
@property(nonatomic,retain) IBOutlet UILabel *label;
@end
@implementation testViewController
@synthesize label;
- (void)viewDidLoad {
[super viewDidLoad];
NSString *path = [[NSBundle mainBundle] pathForResource:@"test-info" ofType:@"plist"];
NSString *versionString = [NSString stringWithFormat:@"v%d", [plistData objectForKey:@"Bundle version"]];
label.text = versionString;
}
@end
但我仍得到了空值在那里我错了
你真的应该只发布与你的问题相关的那部分代码 - 很难浏览上百行代码来找到它... – Vladimir 2010-04-20 13:48:58
另外检查这个问题:http://stackoverflow.com/questions/2657477/how-to-check-bundle-version-for-our-application-by-programming/2657500 – Vladimir 2010-04-20 13:53:58
可能的重复[如何阅读从PList的捆绑版本?](http://stackoverflow.com/questions/2244985/how-to-read-the-bundle-version-from-plist) – 2016-12-26 15:36:19