在使用IB_DESIGNABLE
和IBInspectable
關(guān)鍵字定義xib可視化設置屬性時肌幽,遇到了這個報錯:
Failed to render instance of IB Designables
如圖:
clip_5.png
意思說無法渲染出這個實例對象的這個可視化屬性爬坑,但原因是找不到相應的framework。
stackoverflow上的大佬給出如下解決方案:在target的build setting中添加Runpath Search Paths
筐眷,筆者添加了:
@loader_path/Frameworks
@executable_path/../Frameworks
$(inherited)
另外钓账,需要對xcode做如下額外操作:
1、清理~/Library/Developer/Xcode/DerivedData
2践磅、shift+cmd+K 清理當前build的緩存數(shù)據(jù)
3、重新build
4灸异、在xib上選擇editor菜單的Refresh All Views
菜單項等待build完成和error的消除
親測有效.