使用xib新建了一個UIView,運行時的一個小錯誤:
reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "BFMessageInfoView" nib but the view outlet was not set.'
原因:xib文件到UIViewController程序沒有做關聯
解決方法:
1:View的xib中 點擊"File‘s Owner",設置Class爲對應的ViewControler
2:將View的xib設置爲 File's Owner右鍵"Files‘s Owner", 裏面有個默認的IBOutlet變量view, 看一下有沒有做關聯 關聯後的效果圖