Created
March 16, 2010 20:56
-
-
Save quique123/334497 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(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