아마도 더 좋은 방법이 있지만 사용자가 UIalertView에서 단추를 누를 때 선택 목록을 팝업 싶습니다. 사용자가 선택 목록에서 항목을 두 드릴 때 경고보기가 계속 표시되고 모든 항목을 닫은 상태에서이 목록을 팝업하고 싶습니다.NSRunLoop 타이밍 문제
UIAlertView에서 하위 뷰로 목록을 추가하고 UIalertView를 NSRunLoop과 함께 표시되도록 할 수 있다고 생각했습니다. 선택 목록에 설정된 플래그가있는 while 루프에서 NSRunLoop이 표시됩니다. 그러나 while 루프가 NSRunLoop으로 되돌아 가기 전에 플래그가 설정되지 않기 때문에이 작업을 수행 할 수 없습니다. 두 번째 탭은 while 루프에서 빠져 나오지 만 원하는 것은 아닙니다.
- (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex{
CGRect popUpPickerFrame = alertView.frame;
PopUpPicker *popUpPicker = [[PopUpPicker alloc] initWithFrame:CGRectMake(popUpPickerFrame.origin.x +150,popUpPickerFrame.origin.y-50,115,250)];
popUpPicker.delegate = self;
popUpPicker.aList = [NSArray arrayWithObjects:@"General Plan", @"Light Plan", @"Melatonin Plan", @"Bed Times", @"Done", nil];
popUpPicker.tag = 10;
[alertView addSubview:popUpPicker];
while (popUpPicker.tag == 10) {
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode
beforeDate:[NSDate distantFuture]];
}
[popUpPicker release];
}
나는 사용자가있는 tableView에서 탭 행에 popUpPicker.tag를 설정하고있다 : didSelectRowAtIndexPath : 다음 목록 위임 메소드를 호출 목록의 방법을.
UIAlertView를 닫은 후에 만 작동하도록 팝업 목록을 가져올 수 있습니다.
도움 주셔서 감사합니다.
존