ios上多平台开发(.m与.xib关联)

1、创建一个xib文件,文件类型为view


2 、选中xib,点击File's Owner,设置custom class:(对应.m的文件名)


3、选中xib.点击File's Owner->View,右击设置view,关联当前的view即可


if ([[UIDevicecurrentDevice] userInterfaceIdiom] ==UIUserInterfaceIdiomPhone) {

        self.viewController = [[[gnanViewControlleralloc] initWithNibName:@"gnanViewController_iPhone"bundle:nil]autorelease];

    }else {

        self.viewController = [[[gnanViewControlleralloc] initWithNibName:@"gnanViewController_iPad"bundle:nil]autorelease];

    }



发布了52 篇原创文章 · 获赞 4 · 访问量 18万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章