【问题标题】:How to check is values are set in Settings.bundle如何检查 Settings.bundle 中是否设置了值
【发布时间】:2010-04-06 21:22:17
【问题描述】:

我想知道是否有办法检查我的 Settings.bundle 中设置的值是否为默认值,如果是,请发出警告。

我这样做对吗

‑(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];
   }

我不知道从这里做的是将该按钮(配置 - 其他按钮标题)链接到 settings.app 中的应用程序配置。

谢谢:)

【问题讨论】:

    标签: iphone settings.bundle


    【解决方案1】:

    我认为 Settings.app 没有可用于启动它的 URL 方案。这意味着您无法将“配置”按钮链接到 Settings.app。如果您绝对必须让用户配置一些设置才能使用您的应用程序,您可能需要考虑提供一个界面来使用 NSUserDefaults 在应用程序内编辑设置。

    【讨论】:

    • 我很高兴这没有发布到应用商店!
    猜你喜欢
    • 1970-01-01
    • 2016-12-05
    • 1970-01-01
    • 2015-10-27
    • 2021-12-20
    • 2017-10-25
    • 2013-10-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多