I've looked through some NSURLConnection examples, and all are titled as related asynchronously, although I didn't see any operation queue / thread/ dispatch created. I was wondeirng - does NSURLConnection always preform requests asynchronously or you have to set something special for it?
相关问题
- Load script async?
- C# An asynchronous operation cannot be started at
- aio_write on linux with rtkaio is sometimes long
- await work in chrome console without async wrapper
- Python asyncio: unreferenced tasks are destroyed b
相关文章
- With a Promise, why do browsers return a reject tw
- Asynchronous SHA256 Hashing
- Does aiohttp have ORM?
- Can each Iteration of a for loop/for_each be done
- How does robospice manage activity lifecycle?
- How to call a async function from a synchronized c
- passing multiple arguments to promise resolution w
- Read headers from HttpResponseMessage before Conte
NSURLConnection can be run in synchronous or asynchronous mode depending on what method you call to make the actual connection once you've allocated the NSURLConnection Instance (or use the Class Methods).
For synchronous Connections, you use the method:
+ (NSData *)sendSynchronousRequest:(NSURLRequest *)request returningResponse:(NSURLResponse **)response error:(NSError **)error
For asynchronous connections, you use the methods:
+ (NSURLConnection *)connectionWithRequest:(NSURLRequest *)request delegate:(id < NSURLConnectionDelegate >)delegate
- (id)initWithRequest:(NSURLRequest *)request delegate:(id < NSURLConnectionDelegate >)delegate
- (id)initWithRequest:(NSURLRequest *)request delegate:(id < NSURLConnectionDelegate >)delegate startImmediately:(BOOL)startImmediately
- (void)start
I recommend reading Apple's Documentation on NSURLConnection to find out more information and looking at sample code