iOS - Is it possible to send in continuos connection request to a server?

85 views Asked by At

I have a app code that sends in request only when the app opens. However I need to have a continuos access to the file in the server which will be updated every second.

-(void)viewDidLoad
{
    [super viewDidLoad];

    NSURL *myurl = [NSURL URLWithString:@"URL"];
    NSString *mystring = [NSString stringWithContentsOfURL:myurl encoding:NSASCIIStringEncoding error:nil];
    //myTextView.text = realtime;
    //NSLog(mystring);

    NSString *stripped1 = [mystring stringByReplacingOccurrencesOfString:@"\r" withString:@""];

    NSArray *rows = [stripped1 componentsSeparatedByString:@"\n"];
}

Is there a way that I can keep checking on my server file to load the data? Currently I can load it only once when I open the application. But its a live update application. Thank you.

1

There are 1 answers

1
ciphor On BEST ANSWER

You may use apple notification to notify the user new data.

But I'm not sure if this is what you want.