You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I originally had Swift code like the following to save each block from the API:
func parseTrips (trips:JSON){letrealm=RLMRealm.defaultRealm()
realm.begineWriteTransaction()
for tripJson in trips.arrayValue {Trip.createOrUpdateInRealm(realm, withObject: tripJson.dictionaryObject)}
realm.commitWriteTransaction()}
The code failed because of the arriveAt property on the Location class. I'd like to see a configurator option somewhere, either in RLMObject when it's passed on object or in createOrUpdateInRealm as an argument to cast variables.
Hi @davejlong, we already have a couple of issues tracking this feature request, namely #694, #1272, & #1063. In the meantime, you'll either have to pre-process your dictionaries before passing them into createOrUpdateInRealm, or otherwise look into using something like Realm-JSON or RestKit.
I was recently working with some API data to push into Realm data store formatted like the following:
The JSON is an array of trips for a hired driver. I have models setup in Swift as follows:
I originally had Swift code like the following to save each block from the API:
The code failed because of the arriveAt property on the Location class. I'd like to see a configurator option somewhere, either in RLMObject when it's passed on object or in createOrUpdateInRealm as an argument to cast variables.
Something like:
The text was updated successfully, but these errors were encountered: