简体   繁体   中英

failed to render instance library not loaded [macOS]

I am getting the above error while trying to implement @IBDesignable in my class. 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

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

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 . Doing this fixed the issue for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM