Liumx31
Liumx31

Reputation: 1210

realm class property cannot be marked dynamic

I just upgraded to Xcode 7 and Swift 2 and this line is throwing an Property cannot be marked dynamic because its type canot be represented in Objective-C:

dynamic var log = List<LogEntry>()

Upvotes: 8

Views: 3695

Answers (2)

Valerii Solodovnyk
Valerii Solodovnyk

Reputation: 173

Realm changed it's documentation: Realm Swift 0.95.0 now you should use let instead of dynamic var

Upvotes: 8

esthepiking
esthepiking

Reputation: 1647

I had a similar problem and spent a long time trying to figure it out. My main problem was I went through and removed all dynamic flags after I saw the compile issue, but it would hardly be able to access any data. It appears to be safe to remove the dynamic from all to-many objects, e.g. List<Object>() but leave them there on everything else.

Upvotes: 0

Related Questions