App.MajorVersion, App.MinorVersion, App.BugVersion ?

I was surprised not to find anything similar to the title in iOSApplication. Are these properties really missing, or are they hidden somewhere ?

The build settings are described at length with these properties, but they don’t seem to be present.

They are missing

I am not even going to file a feature request. At this point, I have filed so many for small things like this, I am tired.

At any rate, none of the requests I made for small things ever got granted. Sure, it is less thrilling than grandiose implementations, but once again I am convinced there is nobody at the helm for iOS.

I feel Xojo has bought a brand new set of extra strength ear plugs.

Michel, in case it helps, you can get the bundle version string using this code that somebody provided:

Public Function AppVersion() as Text

  declare function NSClassFromString lib FoundationLib (clsName as CFStringRef) as ptr
  declare function mainBundle lib FoundationLib selector "mainBundle" (clsRef as ptr) as ptr
  declare function objectForInfoDictionaryKey lib FoundationLib selector "objectForInfoDictionaryKey:" _
  (obj_id as ptr, key as CFStringRef) as CFStringRef
  
  Return objectForInfoDictionaryKey(mainBundle(NSClassFromString("NSBundle")), "CFBundleVersion")
  
End Function

I use this in my app to display the app version at the bottom of my Settings view.

Superb. Thank you Jason.

Hum.

As it so happens, I had already implemented that method in XojoiOSWrapper.

The sad thing is, it appears to be broken. It reports simply nothing at all…

It works in my app Michel. Could it have something to do with the contents of the bundle?

I’m not in front of my computer right now, but I believe that you can get these values at build time using a build step. If so, You could create three constants on the app class or in a module and do something like this:

ConstantValue("app.kMajorVersion") = PropertyValue(app.MajorVersion")

And then use the constant in your app.

It works in the XojoiOSWrapper project as well, but not in my latest app.

It may have to do with the fact I am using Jason King’s improved Application. For the moment, I have simply added a constant.

[quote=318016:@Greg O’Lone]I’m not in front of my computer right now, but I believe that you can get these values at build time using a build step. If so, You could create three constants on the app class or in a module and do something like this:

ConstantValue("app.kMajorVersion") = PropertyValue(app.MajorVersion")

And then use the constant in your app.[/quote]

It works fine. I have added MinorVersion and BugVersion, got all my constants.

Thank you Greg :slight_smile: