UIAlertview를 표시하는 뷰 컨트롤러 메서드를 호출 중이며 alertview가 표시되지만 인덱스 메서드에서 클릭 한 단추가 호출 중이 아닙니다. 그것을 고치는 방법?AppDelegate에서 하나의보기 컨트롤러 클래스의 UIAlertView를 표시하고 경고 단추를 클릭하면 인덱스 메서드에서 클릭 한 단추를 누르는 방법?
다음 코드는 TestViewController 클래스
- (void) test
{
UIAlertView *alert1 = [[UIAlertView alloc]initWithTitle:@"OPTUM" message:NSSAlertMessage delegate:self cancelButtonTitle:@"NO" otherButtonTitles:@"YES", nil];
alert1.tag = 3;
[alert1 show];
}
에서 사용하고 도움을, 같은 애플 대리자에서 미리
- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo
{
NSLog(@"Notification Received: %@", userInfo);
NSString *NSSMessage = [NSString stringWithFormat:@"%@", userInfo];
UIStoryboard *storyboard=[UIStoryboard storyboardWithName:@"Main" bundle:nil];
TestViewController *obj1=[storyboard instantiateViewControllerWithIdentifier:@"View Controller"];
[obj1 handleNotificationMessage: NSSMessage];
}
감사를 위의 방법을 호출했다.
클래스에서 clickedButtonAtIndex를 구현하고 있습니까? – dminones
인덱스에서 클릭 한 버튼이 TestVIewController 클래스에 있지만 지금은 App Delegate로 이동했습니다. 그 지금 일하고있어. 응답을 주셔서 대단히 감사합니다. – Sakthimuthiah