views:

193

answers:

2

I have an app holding an array of instances of a class called SwimmingPool.

At present my application persistence is dealt with by encoding everything into NSData and saving that to the iPhone. This is then reloaded everytime the app starts.

I have a few friends populating their individual applications with instances of SwimmingPool. I want them to send me their application information. I will then import it all into my 'master' app, pooling everyones SwimmingPool instances and finally I will submit the app to the appStore.

My question is, What is the best way for me to receive their data? Is it possible for my app to encode to an instance of NSData and then export that to mail on the iphone/ipod touch? (they can email it to me)

I will then create an import method to parse the individual swimming pools into my main NSData.

Is this possible?/the best solution?

Thanks alot everyone who has answered my previous questions. I hope to contribute to this community as much as I can. (not just with questions!)

Dan

+1  A: 

I would have the app post the data to a server via HTTP.

Is it an app for Skateboarders to locate empty swimming pools? Great app idea!

Genericrich
Well its for swimmers if that gives you any clue! Do you know Any good tutorials on using such a HTTP method?Thanks :-)
Dan Morgan
A: 

You should take a look at the NSURLConnection class, which allows you to post data to a HTTP server, or retrieve data from it.

If you don't need the fancy asynchronous download of the HTTP request results, you can also look at [NSData +dataWithContentsOfURL:] to fetch the results synchronously.

jpm
thanks so much. Will check this out.
Dan Morgan
Looking at the NSURLConnection class it is obvious how this can be used to download data but not so obvious as to how it can be used to upload data. With this class is it possible to upload data as well?
Dan Morgan