Saleh Enam Shohag
Saleh Enam Shohag

Reputation: 1119

Use of Unresolved identifier 'RealmOptional'

I am creating a simple model class for realm in swift

import UIKit
import Foundation

class SampleModel: RLMObject {
    dynamic var datauuid: String = ""
    let age = RealmOptional<Int>() //Line 6(getting the error here)

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

But i am getting the error Use of unresolved identifier 'RealOptional' in line 6. Can anyone help me to resolve the error I am using Xcode Version 8.3.3 (8E3004b), and swift: Apple Swift version 3.1 (swiftlang-802.0.53 clang-802.0.42)

Upvotes: 0

Views: 480

Answers (1)

General Failure
General Failure

Reputation: 2597

Import Realm library:

import RealmSwift

If error will not disappear, check linked libraries

Eg if your project use CocoaPods packages, add following string to Podfile:

pod 'RealmSwift'

and launch

pod install

in project library

Look https://cocoapods.org/ for details (or appropriate documentation for your package manager if you are use some other)

Upvotes: 0

Related Questions