Reputation: 18149
Given I uploaded a .plist file to my online website (located at, dunno, www.example.com/data.plist), how do I download that .plist file to my iPhone application and read it successfully?
Upvotes: 0
Views: 2848
Reputation: 53000
Simplest way is to use the NSDictionary
method initWithContentsOfURL:
- this will download the plist specified by URL and build a dictionary from it in one go. Be advised it is a blocking call, for other options and how to avoid blocking start with the documentation for initWithContentsOfURL:
and explore.
Upvotes: 0
Reputation: 14662
NSURL* url = [NSURL URLWithString:@"http://www.example.com/data.plist"];
NSDictionary* dict = [NSDictionary dictionaryWithContentsOfURL:url];
Upvotes: 2