Maybe you can use this code in your AppDelegate didFinishLaunchingWithOptions method:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *localPath = [path objectAtIndex:0]; //The apps document directory
NSString* fileURL = @"http://192.168.100.161/UploadWhiteB/wh.txt";
NSData* data = [NSData dataWithContentsOfURL:[NSURL URLWithString:fileURL]];
if (!(data==nil)) {
[data writeToFile:[localPath stringByAppendingPathComponent:@"wh.txt"] atomically:YES];
NSLog(@"Did download file: wh.txt");
}
}
Then you can get the data by using this code in another class:
-(NSString *) getDocumentDirectory {
NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
return [path objectAtIndex:0]; //The apps document directory
}
NSData *xmlData = [NSData dataWithContentsOfFile:[[self getDocumentDirectory] stringByAppendingPathComponent:@"wh.txt"]];
if(!(xmlData==nil)) {
//Do your stuff
}
The didFinishLaunchingWithOptions method will run every time the app starts and download (and replace) the file wh.txt from your server to the file wh.txt on your device (in your apps document folder).
Then if you wan't to read the file you can use the NSXMLParser. See:
How to Parse XML Files in Xcode and
NSXMLParser example
Does it solve your problem?
If not, provide more information and I will edit my answer.