Skip to content

Instantly share code, notes, and snippets.

@quique123
Created March 16, 2010 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quique123/334497 to your computer and use it in GitHub Desktop.
Save quique123/334497 to your computer and use it in GitHub Desktop.
-(void)downloadPlist{
NSLog(@"Getting xml file");
// USE UDID TO GET FILE - i think this is useless..
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
//Make GET FILE INTERACTIVE
//BUT MAKE THIS ONE GET THE SQLITE FILE OFF THE NET
NSString *prefix = [NSString stringWithString:@"http://www.domain.com/app/"];
NSString *finalString = [prefix stringByAppendingString:@"test2.xml"];
NSLog(@"%@", finalString);
NSURL *theUrl = [NSURL URLWithString:finalString];
NSURLRequest *theRequest = [NSURLRequest requestWithURL:theUrl
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:60.0];
self.pListConnection = [[NSURLConnection alloc] initWithRequest:theRequest
delegate:self
startImmediately:YES];
if (self.pListConnection!=nil) {
NSLog(@"plistconnection OK, file GOT");
} else {
NSLog(@"plistconnection FAILED, No File");
}
}
- (NSString *)getDemoFilePath {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *plistFilenamePath = [documentsDirectory
stringByAppendingPathComponent:@"MySalesData.plist"];
if (plistFilenamePath!=nil) {
NSLog(@"plistFilenamePath OK, file local");
} else {
NSLog(@"plistFilenamePath FAILED, no local file");
}
return plistFilenamePath;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment