Read version from Info.plist

后端 未结 5 1555
北荒
北荒 2021-01-30 02:49

I want to read the bundle version info from Info.plist into my code, preferably as a string. How can I do this?

5条回答
  •  无人共我
    2021-01-30 03:17

    I know that some time has passed since the quest and the answer.

    Since iOS8 the accepted answer might not work.

    This is the new way to do it now:

    NSString *version = (__bridge id)CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle(), kCFBundleVersionKey);
    

提交回复
热议问题