Getting error: Use of unresolved identifier “LinkingObjects”

旧时模样 提交于 2019-12-25 17:17:24

问题


I am getting the following error in my Realm Swift (1.03.1) schema after updating to Cocoapods 1.0.0.

Error:

Use of unresolved identifier "LinkingObjects"

On sample below:

import Foundation
import RealmSwift

class Metric: Object {
    dynamic var UUID: String = ""

    let linkingDimensions = LinkingObjects(fromType: Dimension.self, property: "metric")

    dynamic var createdAt: NSDate = NSDate()
    dynamic var createdBy: Int = CreatedBy.System.rawValue

    override static func primaryKey() -> String? {
        return "UUID"
    }
}

I've tried:

sudo gem uninstall cocoapods // on all cocoapods files
rm -rf Pods
rm -rf ~/Library/Caches/CocoaPods

I then reinstalled, to no avail. I can't seem to find reference to this issue on the Realm Github issues page.

Where should I look to see why Xcode can't find Realm. How can I check if Realm has been properly installed when Cocoapods generates the workspace files and dependencies?

Cheers


回答1:


Resolved this by clearing Xcode's derived project data.

Selecting Window -> Projects menu and deleting the appropriate projects.



来源:https://stackoverflow.com/questions/37409089/getting-error-use-of-unresolved-identifier-linkingobjects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!