相关疑难解决方法(0)

如何阅读PList的Bundle版本?

有没有办法读取应用程序的捆绑plist文件,我想拉取Bundle版本的值.

iphone

48
推荐指数
2
解决办法
2万
查看次数

如何从iphone中的项目test-Info.plist中的标签中检索Bundle Version?

在这里,我正在粘贴我的代码,我想从我的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)

但在我错了的地方,我仍然得到零值

iphone ios

4
推荐指数
1
解决办法
4219
查看次数

标签 统计

iphone ×2

ios ×1