Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/104.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何获取自己的捆绑包信息?_Ios_Nsbundle - Fatal编程技术网

Ios 如何获取自己的捆绑包信息?

Ios 如何获取自己的捆绑包信息?,ios,nsbundle,Ios,Nsbundle,我想获得myBundle.bundle的一些信息,如版本、创建时间以及标识该bundle的信息。最新信息可能由我自己编写,并设置在myBundle.bundle中 有什么推荐的方法吗 我试着这样做,但没有成功: 我将名为Info.plist的plist放入myBundle.bundle的根中。 阅读如下信息,但信息为零: self.bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"myBundle

我想获得myBundle.bundle的一些信息,如版本、创建时间以及标识该bundle的信息。最新信息可能由我自己编写,并设置在myBundle.bundle中

有什么推荐的方法吗

我试着这样做,但没有成功:

我将名为Info.plist的plist放入myBundle.bundle的根中。 阅读如下信息,但信息为零:

self.bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"myBundle" ofType:@"bundle"]];
NSDictionary * info = [self.bundle infoDictionary];

您可以使用以下代码行获取捆绑包版本

NSString * bundleVersionString = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];

NSDictionary*infoDictionary=[[NSBundle mainBundle]infoDictionary]

NSString build=infoDictionary[nsstringkcfbundleverionkey]


这将提供所有信息。它存储在plist-like-version、bundle-version、display-name等中。

我不想获取应用程序的版本,我想获取自己bundle的版本。有什么推荐的方法吗?否则我应该写我的方式的信息。