complete - Checking for NSURL load done -


I am looking for "end, or expired" thing in NSURL -> NSstring initWithContentsOfUrl

I've got "URLResourceDidFinish Loading" but it's going to be depleted

I can not find anybody, but maybe I searched for the wrong thing.

Thank you in advance

/ div>

If you type -initWithContentsOfURL: < / Code> to NSString , it has been done.

But even if you are using it, then it is a synchronous method - which means that as long as the data is loaded into the result as NSString , Your code will stop till then.

  NSURL * url = [NSURL URLWithString: @ "http://google.com"]; NSString * html data = [NSString stringWithContentsOfURL: url]; NSLog (@ "% @", html data);  

So, just be clear: for two reasons this is a bad behavior :

  1. You are using a deprecated method which will be removed at most on future SDK versions, and;
  2. You are freeing your UI while loading something from the network while giving any feedback from the user.

Whatever you need to do is probably to create your request object and actually load it from the network.


Comments