0
Imは、タイマーを使用してアプリケーションを作成して、ポップアップがエブリー示して表示する方法を30秒変更コードは、バックグラウンドモードでのポップ・アップUIAlertvewがバックグラウンドで実行されているapplicacation
Imは、タイマーを使用してアプリケーションを作成して、ポップアップがエブリー示して表示する方法を30秒変更コードは、バックグラウンドモードでのポップ・アップUIAlertvewがバックグラウンドで実行されているapplicacation
あなたが表示することはできませんを表示する方法
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[window addSubview:viewController.view];
[window makeKeyAndVisible];
timer = [NSTimer scheduledTimerWithTimeInterval:(30)
target:self
selector:@selector(showpopup:)
userInfo:nil
repeats:YES];
}
-(void) showpopup:(NSTimer *)theTimer{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"YAHooo!" message:nil delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}
アプリケーションがバックグラウンドのときにUIAlertViewを実行します。あなたはUIAlertView形式で提供されるUILocalNotificationを使うことができますが、各アプリの通知数には制限があります。 UILocalNotificationをスケジュールするには、tutorialに従ってください。
Thnx助けてください) – Ruslan
NSTimerとUILocalNotificationを追加する方法を教えてもらえますか?ファイルをappdelegateして30秒ごとに表示する方法はありますか? – Ruslan
バックグラウンドタスクを開始しない限り、NSTimerはバックグラウンドにいるときには機能しません。 http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html –