Failed to render instance of IB Designables

2019-01-12 23:08发布

I have an Objective-C and Swift mixed dynamic framework. And the mixed framework was linked with two pure Objective-C dynamic frameworks.

When I tried to mark any class in the mixed framework with IB Designable and using that class in either storyboard or nib, the Xcode always says the instance of it was failed to render.

And there was the error message:

IB Designables: Failed to render instance of WZUITokenField: dlopen(WZUIKit.framework, 1): Library not loaded: /Library/Frameworks/WZFoundation.framework/WZFoundation Referenced from: WZUIKit.framework Reason: image not found

IB Designables: Failed to update auto layout status: dlopen(WZUIKit.framework, 1): Library not loaded: @rpath/WZFoundation.framework/WZFoundation Referenced from: WZUIKit.framework Reason: image not found

The framework WZUIKit is an Objective-C and Swift mixed framework and the WZFoundation is pure Objective-C.

Plus, all these sutff work on either device or the simulator.

13条回答
男人必须洒脱
2楼-- · 2019-01-13 00:10

Follow the below steps:

  1. If there are any conflicts in the storyboard, resolve them correctly, check if the xml is correctly validated.(These is main step.)
  2. Clean the project.
  3. Delete the derived data folder.
  4. Quit Xcode and restart it again. (I had to do this twice.)
查看更多
登录 后发表回答