iphone - iOS 应用程序仅在第一次使用该应用程序时发送警报 View

标签 iphone ios uialertview

我想在用户第一次打开应用程序时显示一个提醒 View 。打开应用程序后,他们单击一个按钮,将表格 View 推送到导航 Controller 堆栈上。如果这是第一次打开 TableView ,则应该显示一个警告 View ,告诉用户他们可以单击单元格进行编辑。

我怎样才能做到这一点?

谢谢

最佳答案

简单地说,使用NSUserDefaults

类似于:

// the place where you want to check if this is the first run:
BOOL didRunBefore = [[NSUserDefaults standardUserDefaults] boolForKey:@"didRunBefore"];

if (!didRunBefore) {
    // show alert;
    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"didRunBefore"];
    [[NSUserDefaults standardUserDefaults] synchronize];
}

关于iphone - iOS 应用程序仅在第一次使用该应用程序时发送警报 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11546473/

相关文章:

iphone - UIAlertView消息太长

iphone - 存储 cookie 以保留 iPhone 应用程序的凭据

iphone - 当设备旋转时,如何显示横向 coverflow 样式 View ?

ios - 在 UIPickerView 上选择后显示整个数字值?

ios - 使用百分比填充 UIView

objective-c - 基于导航的应用程序中屏幕底部的 "Back"按钮

swift - UiAlertView 或 UiAlertController 在 Swift 中只显示一次

ios - 如何隐藏和取消隐藏 UIAlertView。?

iPhone localstorage 生命周期 - 它是否在应用程序更新后仍然存在?

ios - Touch ID - 如何进入密码屏幕? - swift