小编use*_*245的帖子

在第一次启动iPhone应用程序时,如何让UIAlertView只出现一次?

UIAlertView应用程序启动后,我正在使用它来弹出一个弹出窗口.它工作正常,但我只希望弹出窗口出现在应用程序的第一次启动时.目前,我已经得到了UIAlertViewAppDelegate类中applicationDidFinishLaunching的方法.这是我的代码:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
sleep(4);
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Welcome!" message:@"SAMPLE!!!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
Run Code Online (Sandbox Code Playgroud)

我是应用程序开发的新手,很抱歉,如果这很简单的话.

iphone xcode cocoa-touch uialertview

6
推荐指数
2
解决办法
7251
查看次数

标签 统计

cocoa-touch ×1

iphone ×1

uialertview ×1

xcode ×1