0
앱이 활성화되어있는 경우 알림을 표시하려면 다음 코드를 따라야합니다. AppDelegate.m에 넣습니다.알림 버튼을 누른 후 전환 수행
사용자가 두 번째 단추를 누르면 뷰 컨트롤러로 전환 (또는 세그)을 수행하려고합니다. 어떻게 AppDelegate에서이 작업을 수행 할 수 있습니까?
나는 navigationcontroller를 appdelegate로 설정해야한다고 생각한다. 그러나 나는 이것을 달성 할 수 없었다.
감사
당신이 UINavigationController가 사용할 수있는 옵션으로- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
UIApplicationState state = [application applicationState];
if (state == UIApplicationStateActive) {
NSString *cancelTitle = @"Close";
NSString *showTitle = @"Show";
//NSString *message = [[userInfo valueForKey:@"aps"] valueForKey:@"alert"];
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Social Dilemma"
message:@"Next round is ready to play!"
delegate:self
cancelButtonTitle:cancelTitle
otherButtonTitles:showTitle, nil];
[alertView show];
}
}
-(void) alertView: (UIAlertView *) alertView
clickedButtonAtIndex: (NSInteger) buttonIndex {
if (alertView.tag == 1)
{
//check the button index
//create and display the other alert view (set the tag property here to 2)
}
else if (alertView.tag == 2)
{
}
}