I have a textview that downloads the text from a .txt on my server. The only problem is that it will only do that once-- no matter if I update the .txt file or not, the text will not change.
Here is the code for the textview:
- (void)viewDidLoad
{NSError *error = nil;
NSURL *myurl = [NSURL URLWithString:@"http://www.myserver.com/test.txt"];
NSString *mystring = [NSString stringWithContentsOfURL:myurl encoding:NSUTF8StringEncoding error:&error];
newtext.text = mystring;
}
Can't seem to figure out how to make it check the server each time the app runs (and not just cache what it found the first time). This happens in the simulator and on a real iphone as well.
Thanks for any help!