user2722667
user2722667

Reputation: 8651

swift ios should I use core data or array/struct

I wonder how I should receive data in my app.

Right now I have a relational sql file that I took form my server/backend.

Its a two tables state/cities that is relational one-to-many

In one table I have around 30 states In table two I have around 250 states.

Is the best solution to save it in core data or in a array/struct?

Upvotes: 0

Views: 282

Answers (1)

Abcd Efg
Abcd Efg

Reputation: 2146

A cleaner approach would be to convert it to JSON in your backend. And then in your App use NSJSONSerialization and convert it to NSDictionary. Then you can save the dictionary to a file and load and use it on demand.

Upvotes: 1

Related Questions