-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store and Fetch an array #188
Comments
@sylvan-d-ash Hi, when you load, can you try let world = try storage.object(ofType: [World].self, forKey: "Constants.World") Basically, use |
Hi @sylvan-d-ash! Did you figure out what went wrong? |
@MarkHao yes, I did. I should have commented about it here, because I now don't remember the problem clearly, but it had to do with the I'm guessing that adding an |
@onmyway133 ,@sylvan-d-ash - Can you show how you created the Storage initializer function. When we are creating the Storage class init method it also asks for Transformer type. let diskConfig = DiskConfig(
Here my User is. -
} But what i want to achieve is that , i want to cache a array of [User] . How do i do that , do I need to change my Storage init method . |
Hi @bhanuMatta, sorry for the late reply, where you able to resolve your issue? |
I would like to know how to store and subsequently fetch an array. I've got the following models:
I'm saving the
World
info like:And trying to fetch this data later on like:
The saving seems to work OK, but I get the following error whenever I try to fetch the data from the cache:
The data couldn’t be read because it isn’t in the correct format.
Any idea what I could be doing wrong? Or how should I save the above data?
The text was updated successfully, but these errors were encountered: