我想在用户第一次打开应用程序时显示一个提醒 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/