I'm trying to implement persistence for a simple data model of an iOS app. It's kind of a database, but with a small amount of data (200-500 entries). I think core data is no option here.
The data model looks somehow like this (currently I use NSDictionary
with NSArray
):
// Note: NSStrings and NSNumbers are simplified for readability (no @)
@{ "Companys" : @[
@{ "ID" : 1,
"Company name" : "ABC Inc.",
"Website" : "http://www.abc.com"
},
@{ "ID" : 2,
"Company name" : "XYZ Inc.",
"Website" : "http://www.xyz.com"
},
@{ "ID" : 3,
"Company name" : "123 Inc.",
"Website" : "http://www.123.net"
},
// ... about 90 companies
],
"Employees": @[
@{ "ID" : 1,
"First name" : "John",
"Last name" : "Doe"
},
@{ "ID" : 2,
"First name" : "David",
"Last name" : "Green"
},
// ... about 500 employees
]
}
Now I'm facing the problem of relationships (which employees work in which company). I thought of adding and NSArray
to the company NSDictionary
which holds the IDs of the employees of that company. But somehow I'm afraid of bad performance as I would need to enumerate all companies each time I want to get the company which an employee works for.
Is there any better solutions for saving this kind of data? I think using SQLite or Core Data would be way to over-engineered and would cost too much development time...
EDIT: Please don't suggest Core Data in your comments and answers. Core Data is not an option as the data is very static with only few changes, and sorting is not needed. Also iCloud synchronization might be an option. Core Data has plenty of bugs when using iCloud...