Reputation: 1594
My app is mixed Objective-C and Swift, which forces me to use Realm for Objective-C. Now, I'm creating a new Realm model in Swift with an embedded RLMArray
.
@objcMembers class KTPRestaurant: RLMObject {
var name: String?
dynamic public var tables: RLMArray<KTPTable>?
}
However, I keep getting an error saying that 'Property 'tables' is declared as 'id', which is not a supported RLMObject property type.
. How should I declare the RLMArray
?
Upvotes: 1
Views: 1026
Reputation: 50
You should declare your RLMArray properties with the following syntax:
@objc dynamic var tables = RLMArray< KTPTable >(objectClassName:KTPTable.className())
Please refer to this RLMArray Properties from the Realm Docs. If you have face this issues : Terminating app due to uncaught exception 'RLMException'. Means You need to uninstall the app and reinstall the app to update the Realm.
Upvotes: 1