I am trying to get my version number of my app using:
NSString * version = [[NSBundle mainBundle] objectForInfoDictionaryKey: @"CFBundleShortVersionString"];
but it crashes with this error:
[NSString stringWithUTF8String:]: NULL cString
What am I doing wrong?
Check your info.plist to make sure short version (CFBundleShortVersionString) or (Bundle versions string, short) is set.
Your code is fine. But you can also call it this way: