Sorry if this has been asked many times before, but nothing seemed to help my issue.
I have set up my app to work perfectly reading from local .plist files from within the app itself for testing purposes, but for the app to be of any use, I need to be able to update it on a web server and load it remotely.
Here is my current code for local plists.
How would I amend this with minimum changes elsewhere in the app?
Many thanks in advance.
- (void)viewDidLoad
{
[super viewDidLoad];
//Create a dictionary with the contents of Squad.plist
NSDictionary *dictionary = [[NSDictionary alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Squad" ofType:@"plist"]];
//Fill the Squad array with contents of dictionary under the key "Players"
[self setSquad:(NSArray*) [dictionary objectForKey:@"Players"]];
//Reload the table data
[[self tableView] reloadData];
[[self navigationItem] setPrompt:nil];
}
You will need to first download your remote .plist while showing a loading or something, and after it’s downloaded, use it locally the same way you are doing now. There’s no way to read it remotely.