Guest User

Untitled

a guest
Nov 22nd, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. case timezoneSetting: {
  2. UIViewController *pickerViewController = (setting.type == timeSetting) ?
  3. [[[TimePickerViewController alloc] initWithSetting:setting] autorelease] :
  4. [[[TimeZonePickerViewController alloc] initWithSetting:setting] autorelease];
  5.  
  6. if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
  7. CGRect frame = [self.tableView rectForRowAtIndexPath:indexPath];
  8. CGRect cellRect = CGRectMake(frame.origin.x, frame.origin.y - tableView.contentOffset.y, frame.size.width, frame.size.height);
  9.  
  10. [pickerPopover setContentViewController:[[[UINavigationController alloc] initWithRootViewController:pickerViewController] autorelease]];
  11. [pickerPopover presentPopoverFromRect:cellRect inView:self.view permittedArrowDirections:(UIPopoverArrowDirectionRight | UIPopoverArrowDirectionUp) animated:YES];
  12. }
  13. else {
  14. [self.navigationController pushViewController:pickerViewController animated:YES];
  15. }
  16.  
  17. break;
  18. }
Add Comment
Please, Sign In to add comment