1个viewController怎么关联2个XIB,一个是iphone的XIB,一个是ipad的xib

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {                         
   YourViewController *vc = [[[YourViewController alloc]                
initWithNibName:@"YourViewController_iPhone" bundle:nil] autorelease];
} else {
  YourViewController *vc = [[[YourViewController alloc]  initWithNibName:@"YourViewController_iPad" 
bundle:nil] autorelease];
}

你可能感兴趣的:(1个viewController怎么关联2个XIB,一个是iphone的XIB,一个是ipad的xib)