Simple title output in ios settings bundle

后端 未结 6 2081
名媛妹妹
名媛妹妹 2021-02-01 21:17

I just want to output the version number of my ios application in a settings file.

I understand that I have to add the settings file to the application folder.

W

6条回答
  •  無奈伤痛
    2021-02-01 21:48

    I had the same issue. To display Title property in the Settings.bundle you need also to add "Default Value" (it could be empty).

    1) Right click on the Title object (in my case it is Item 0) and select Add Row.

    2) In the drop down of the created row select "Default Value"

    enter image description here

    3) In didFinishLaunchingWithOptions set value to NSUserDefaults you want to display, for example:

    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults setValue:@"0.0.1" forKey:@"appVersion"];
    [defaults synchronize];
    

    Result:

    enter image description here

提交回复
热议问题