iOS 8을 실행하는 iPhone에서 아래 코드는 작업 시트를 팝업합니다. 그러나 iOS 8을 실행하는 iPad에서 아래 코드는 액션 시트가 나타나지 않고 대신 아무 일도 일어나지 않습니다.iOS 8 iPad 만 동작 시트가있는 버그
NSUserDefaults *defauj = [NSUserDefaults standardUserDefaults];
NSArray *cod = [defauj objectForKey:@"customlistofstuff"];
UIActionSheet* actionSheet = [[UIActionSheet alloc] init];
actionSheet.delegate = self;
for(int i=0;i<[cod count];i++)
{
[actionSheet addButtonWithTitle:[cod objectAtIndex:i]];
}
actionSheet.cancelButtonIndex = [actionSheet addButtonWithTitle:@"None"];
[actionSheet showInView:[UIApplication sharedApplication].keyWindow];
시도해 주셔서 감사합니다. 그러나 작동하지 않았습니다 ... –
이 코드는 내 앱에서 직접 사용하며 저에게 적합합니다. '[[[UIApplication sharedApplication] delegate] window] .rootViewController.view' – Greg
그래도 그래도 작동하지 않지만 최소한 디버거에서는 오류가 발생합니다. Warning : Attempt의 을 윈도우 계층 구조에 표시하지 않음 –