我使用UIAlertView
在应用程序启动后弹出窗口。它工作正常,但我只想弹出窗口出现在应用程序的第一次启动。目前我已经在AppDelegate
类中获得UIAlertView
,在applicationDidFinishLaunching
方法中。这里是我的代码:如何在iPhone应用第一次启动时使UIAlertView只出现一次?
- (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];
我是新来的应用程序开发,所以很抱歉,如果这很简单。
的讨论是不是'registerDefaults:'多余? – zoul 2010-04-05 14:35:14