在这里,我正在粘贴我的代码,我想从我的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
Run Code Online (Sandbox Code Playgroud)
但在我错了的地方,我仍然得到零值
Lia*_*iam 36
以下行将为您检索版本
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4219 次 |
| 最近记录: |