问题
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