File::getVersion uses cached data on MacOS

If you call File::getVersion on MacOS, upgrade the version and call File::getVersion again you get old cached data. Some kind of info.plist caching.

Anyone know a good workaround? :slight_smile:

Also - can the documentation be updated to reflect this as it’s a very subtle bug that appears not to be documented by apple!

The internet suggests reading the info.plist file directly (instead of using NSBundle) might work, in which case I’d suggest this as a fix for getVersion.

NSString *infoPlistFilePath = [NSString stringWithFormat:@"%@/Contents/Info.plist", [[NSBundle mainBundle] bundlePath]];
NSString *infoDictionary = [NSDictionary dictionaryWithContentsOfFile:infoPlistFilePath];
NSString *value = [infoDictionary valueForKey:@"InfoPlistKey"];```

Can confirm, reading the info.pList directly and bypassing NSBundle returns the actual version of the app instead of the cached one!