Hi, im trying to download a plist from a server and save it to the documents folder but it does not seem to work. Any help?
Here is what i have.
Code:
-(IBAction)getPlist{
NSString *folder = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
NSString *path = [folder stringByAppendingPathComponent:@"Data.plist"];
NSURL *theFileURL = [NSURL URLWithString:@"http://www.somesite.com/Data.plist"];
NSDictionary *newPlist = [[NSDictionary alloc] initWithContentsOfURL:theFileURL];
[newPlist writeToFile:path atomically:YES];
[newPlist release];
}