私のアプリケーションでは、プッシュ通知機能を実装しており、通知を受け取っています。appDelegate ファイルで次のコードを使用しました。
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
for (id key in userInfo) {
NSMutableArray *array = [userInfo objectForKey:key];
NSString *message = [NSString stringWithFormat:@"%@",[array valueForKey:@"alert"]];
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"iPhoneApp" message:message delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil];
[alert show];
[alert release];
}
}
プッシュ通知アラート(アプリ起動時)のOKボタンクリックイベントでアクションを起こしたい。このアプリには 3 つのビュー コントローラーがあります。したがって、どのクラスにコードを追加する必要がありますか
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
?