views:

18

answers:

1

How can I detect and properly report a connection error when executing this line of code:

NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:feedUrl];

Is there a clean way to do it or will I have to break this up code up into NSURLRequest, NSURLConnection, etc...

A: 

You can check the return value. If it is nil, something went wrong. If you want to know, if the URI wasn't valid, the server did not respond, the data were invalid, you need to use an NSURLRequest.

unset