我使用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