"making stringwithcontentsofurl asynchronous - is it safe?" Code Answer


that should be safe, but why reinvent the wheel?

nsurlrequest *req = [nsurlrequest requestwithurl:[nsurl urlwithstring:@"http://www.google.com"]];
[nsurlconnection sendasynchronousrequest:req queue:[nsoperationqueue mainqueue] completionhandler:^(nsurlresponse *response, nsdata *data, nserror *error) {
    nsstring *result = [[nsstring alloc] initwithdata:data encoding:nsutf8stringencoding];
    // etc
By neo108 on September 11 2022

Answers related to “making stringwithcontentsofurl asynchronous - is it safe?”

Only authorized users can answer the Search term. Please sign in first, or register a free account.