开发者

How to check is values are set in Settings.bundle

开发者 https://www.devze.com 2022-12-25 16:28 出处:网络
I\'d like to know if there is a way of checking whether the values set in my Settings.bundle are default values, and if they are, give a warning.

I'd like to know if there is a way of checking whether the values set in my Settings.bundle are default values, and if they are, give a warning.

Would I be correct in doing this

‑(void)ViewDidLoad {
   if ([[NSUserDefaults standardUserDefaults] stringForKey:@"textEntry_key"] == @"" ||[[NSUserDefaults standardUserDefaults] stringForKey:@"textEntry_key2"] == @"") {
      UIAlertView *settings = [[UIAlertView alloc] initWithTitle=@"Configuration Error" message=@"Default values present in application settings. Please configure." delegate=self cancelbuttontitle = nil otherbuttontitles=@"Configure", nil];
      [settings show];
      [settings release];
   }

What I don't know to do from here is to link that button (Configure - otherbuttonti开发者_开发知识库tles) to the application configuration in settings.app.

Thanks :)


I don't believe that Settings.app has a URL scheme available to launch it. This would mean that you cannot link your "Configure" button to Settings.app. If you absolutely must have the user configure some settings before being able to use your app, you may want to consider providing an interface to edit the settings from within the app using NSUserDefaults.

0

精彩评论

暂无评论...
验证码 换一张
取 消