[英]failed to render instance library not loaded [macOS]
I am getting the above error while trying to implement @IBDesignable
in my class. 我在课堂上尝试实现
@IBDesignable
时遇到上述错误。 I have tried all the online solutions like deleting derived date updating pod etc. But nothing is working for me. 我已经尝试了所有在线解决方案,例如删除派生日期更新窗格等。但是没有任何工作对我有用。 I am using
cocoapods version 1.2.1
This is how my class looks 我使用
cocoapods version 1.2.1
这是怎么了我的类看起来
import Cocoa
@IBDesignable class ClassName: NSView {
required init?(coder: NSCoder) {
super.init(coder: coder)
commonInit();
}
override init(frame frameRect: NSRect) {
super.init(frame: frameRect)
commonInit();
}
func commonInit(){
wantsLayer = true;
}
override func prepareForInterfaceBuilder() {
layer?.backgroundColor = NSColor.darkGray.cgColor
}
}
This is how my podfile looks 这是我的Podfile的样子
source 'https://github.com/CocoaPods/Specs.git'
platform :osx, ’10.11’
target 'ProjectName’ do
use_frameworks!
pod 'SwiftDate', '~> 4.1.7’
end
This is the screenshot of the error i am getting 这是我遇到的错误的屏幕截图
in my target project i went to Runpath Search Paths
and edited @loader_path/Frameworks
to @loader_path/../Frameworks
. 在我的目标项目中,我转到“
Runpath Search Paths
并将@loader_path/Frameworks
编辑为@loader_path/../Frameworks
。 Doing this fixed the issue for me. 这样做为我解决了这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.