I have had some luck using plists...
You will need to install the plist-3.0.0 gem (gem install plist IIRC)
Then in your controller you setup something like this:
plist = {'a' => 'b', 'c' => 'd', 'e' => {'f' => 'g', 'h' => {'i' => 'j'}}}.to_plist
render(:text => plist)
Then in your iphone app setup something like this:
NSURL *url = [NSURL URLWithString:@"http://somewhere.com"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
NSURLResponse *response;
NSError *error;
NSData *plistData;
plistData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
NSPropertyListFormat format;
NSString *errorStr;
id imagesToRate = [NSPropertyListSerialization propertyListFromData:plistData mutabilityOption:NSPropertyListImmutable format:&format errorDescription:&errorStr];
if(!imagesToRate) {
NSLog(errorStr);
} else {
NSLog(@"%@", [imagesToRate objectForKey:@"e"]);
}
You pretty much get all the freedom of using json (as in, you don't have to roll your own xml scheme to format your data, and serialization is as easy as a to_plist call) plus, the sdk comes with native code for handling plists.
But, if you all ready have a web-service that outputs in json/xml you might want to keep that and just parse the stuff on the iphone using the stuff already mentioned (TouchXML, json-framework)