Start a new topic

NSNumber, NSArray, NSDictionary in iOS SDK 3.3.6

I am converting my app from iOS SDK v1 to iOS SDK 3.3.6. I have NSNumber, NSDictionary and NSMutableArray in my data models, which worked fine with the earlier SDK. Now when I fetch my objects these items are nil. I understand I may need to use a transform, but I haven't been able to get these to work. Am I missing something? Are these data types supported?

This is likely related to the .collection() method.  Since the SDK 3, it is defaulted as "cache" type.  Therefore, your problem is likely due to your cache file (realm) does not accept your data types.

Quick solution is to force the collection to look to the network and not save to the local device using the following:

datastore = DataStore<Entity>.collection(.network)

HI James - thanks for the reply. Yes, that is exactly what I'm doing: let store = DataStore<DataServiceType>.collection(.network). Is anyone else having this problem? Do I need to use a transform? I've tried them with no luck....

Login or Signup to post a comment