Closed edwardIshaq closed 9 years ago
@edwardIshaq what version of Swift are you using? That works fine for me in Swift 2.0 beta 4
Im on swift 1.2 unfortunately :(
My current patch just to make it compile and work for the time being :
func cacheAllObjects() -> [Object] {
let cache: [T] = Realm().objects(Contact.self).toArray() as! [T]
self.elements = cache
return self.elements
}
I'm pushing my app via TestFlight, If i move to swift 2.0 I'll probably will lose that option, no ?
Hm, in that case could you share a project with us, either here or privately at help@realm.io, that demonstrates the issue so we can investigate? Thanks!
Thanks Sam, I'll prepare it and send it over.
The root cause of the issue is subclassing DataSource<Object>
-- if that's changed to DataSource<T>
, everything should work as expected!
Sweet :+1: Thanks Sam
Hi,
I have a similar issue to #1916 where I'm trying to create a dataSource to work with different Object subclasses. This worked fine before on the Realm but started getting the same error log as #1916 once i converted the code to RealmSwift
Any idea of a workaround this issue ?