I have an iPad application that pulls in all of its data from an external web service. I am working on building in a demo mode that will use a cache of demo data stored on the device so it can be demoed and tried out without the web service connection (or an internet connection.)
Is there a project or good practices standard to follow to model this type of sample data? I’m expecting JSON arrays/Dictionaries back from my web service, how could I build a function that uses hardcoded data to create the NSMutableData object I’d expect to get back from a JSON web request?
I always stick sample data in a plist file in my resource directory. Obviously it can be created as, say, an array of dictionaries etc, and so can be loaded directly from file:
Equivalent method exists for arrays. Obviously it might be slightly different format to your JSON array but ease of importing wins for me!