Setting bundle default value won't set

前端 未结 5 969
小蘑菇
小蘑菇 2021-01-04 02:29

I have an iOS application with a settings.bundle that handles various settings for my application with Switch toggle. I set default values in my root.plist file

5条回答
  •  抹茶落季
    2021-01-04 02:55

    This blog post might help : http://greghaygood.com/2009/03/09/updating-nsuserdefaults-from-settingsbundle

    tl;dr - until the user opens the settings page then the defaults aren't copied into your app. This is the expected behavior by Apple.

    Personally, I think this is terrible. It means that you will have to set your defaults in code just in case the user starts your app without going to the settings page first (which will be true for about 99% of use cases!)

提交回复
热议问题