2017-11-22 15 views
0

내가 iPad에서 팝 오버에 피커보기를 표시하기 위해 노력하고 있지만, 팝 오버가아이폰 OS 빈 팝 오버

case timezoneSetting: { 
     UIViewController *pickerViewController = (setting.type == timeSetting) ? 
       [[[TimePickerViewController alloc] initWithSetting:setting] autorelease] : 
       [[[TimeZonePickerViewController alloc] initWithSetting:setting] autorelease]; 

     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { 
      CGRect frame = [self.tableView rectForRowAtIndexPath:indexPath]; 
      CGRect cellRect = CGRectMake(frame.origin.x, frame.origin.y - tableView.contentOffset.y, frame.size.width, frame.size.height); 

      [pickerPopover setContentViewController:[[[UINavigationController alloc] initWithRootViewController:pickerViewController] autorelease]]; 
      [pickerPopover presentPopoverFromRect:cellRect inView:self.view permittedArrowDirections:(UIPopoverArrowDirectionRight | UIPopoverArrowDirectionUp) animated:YES]; 
     } 
     else { 
      [self.navigationController pushViewController:pickerViewController animated:YES]; 
     } 

     break; 
    } 
+0

를 호출 할 필요가 무엇 이었습니까 비어 만들고 UIPickerView 귀하의 popover보기에 추가 –

+0

어쩌면 내가 뭘 놓친거야,이 레거시 코드 및 initwithRootViewController 생각 : pickerViewController 처리해야 했어? 그렇게 생각하지 않습니까? –

+0

일 수 있습니다. 당신은'TimePickerViewController'의 구현을 점검하고 실제'pickerView'가 추가되었는지 확인해야합니다. –

답변

0

[pickerPopover initWithContentViewController:pickerViewController] 우리는 당신이 얼마나의 코드를 추가하십시오