tags:

views:

23

answers:

1

I basically want to make part of my iphone app display schedule within the app, my thought is to make an xml template and then edit the file on the webserver as the schedule changes, then as a user views the file the schedule will load. My question would be what the best way would be to implement this? Just call the URL? I would like to also save the XML (storage) data until user refreshes so it can be views if the device is offline and/or the webserver is down.

I'm thinking of using PhoneGap for the schedule page, would that work?

Also I'm a very new developer so I'm learning everything as I add it here.

A: 

For your first connected application, I would recommend modelling it after the Apple sample app, SeismicXML.

http://developer.apple.com/iphone/library/samplecode/SeismicXML/Introduction/Intro.html

This application does everything you want from your application except for saving the XML to disk. For this, I would recommend the following, assuming that you read the XML file in "myArray" before calling this code:

NSString *path = [[NSBundle mainBundle] pathForResource:@"myArrayAsPlistPath" ofType:@"plist"]; 

//this will create a plist (xml file with special format) in the app's main directory.
//You can easily read this plist into an array.
[theArray writeToFile:path atomically:YES];
Andrew Little