美文网首页
1个viewController怎么关联2个XIB,一个是iph

1个viewController怎么关联2个XIB,一个是iph

作者: PengPengPro | 来源:发表于2016-10-15 19:07 被阅读24次
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,一个是iph

      本文链接:https://www.haomeiwen.com/subject/nacoyttx.html