2017-11-22 11 views
0

私はiPadのポップオーバーでピッカービューを表示しようとしていますが、ポップオーバーが空であるiOSの空のポップオーバー

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'を作成して追加します。 –

+0

これは私が紛失していることです。これはレガシーコードであり、私はinitwithRootViewController:pickerViewControllerがそれを処理すると考えていましたか?だから私はないと思いますか? –

+0

かもしれません。あなたがTimePickerViewController' 'の実装をチェックし、そこにある –

答えて

0

[pickerPopover initWithContentViewController:pickerViewController]は、我々はあなたがどのようにコードを追加してください

関連する問題