我試圖使自定義視圖UITableView
頭一個自定義視圖中查看插座沒有設置,但不幸的是,我得到一個異常:加載的筆尖,但同時賦予了UITableView中的頭球
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "ImagesView" nib but the view outlet was not set.'
第一,在HomeViewController中我創建了一個tableView,然後用xib文件創建了ImagesViewController,在那裏設計了我的自定義視圖。
而在最後,我嘗試分配ImagesView作爲我的tableView頭:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
ImagesViewController *imagesView = [[ImagesViewController alloc] init];
tableView.tableHeaderView = imagesView.view;
}
我在做什麼錯?我是iOS開發的新手,並且自己弄明白。
感謝您的幫助!
也調用的ViewController筆尖file.like此ImageViewcontroller *的ImageView = [[ImagesViewController的alloc] initwithnibname:@ 「ImageViewController」 束:無]; – vishiphone
謝謝,你的建議有效! – Oleg
Welcome.if評論對你有幫助,然後點擊我的評論中的箭頭標記。 – vishiphone