Depends on the data you use. Something simple like this is synchronous and useful from time to time:
NSURL *url = [NSURL URLWithString:@"http://someaddress.asp?somedatarequest=1"]; NSArray *dataArray = [NSArray arrayWithContentsOfURL:url];
(Equivalent also exists for dictionaries)
In this case, the system will expect a response from someaddress.asp - therefore, it is best to put something like this in the background thread.
If you have control over the data format on the other end, this can be a quick and easy way to get data in the iPhone / iPad app ...
Change - you just need to specify the obvious, which is usually best asynchronously! You should not wait, connecting system resources, especially if the remote server has died, etc .... :)
h4xxr
source share