- 1 NSURLRequest *request = ...
- 2 NSURLConnection *connection = [[NSURLConnection alloc]
- initWithRequest:request
- delegate:self
- startImmediately:NO];
- 3 [connection scheduleInRunLoop:[NSRunLoop currentRunLoop]
- forMode:NSRunLoopCommonModes];
- 4 [connection start];
- 第3句的作用:
- The reason the connection delegate messages aren't firing until you stop scrolling is because during scrolling,
- the run loop is in UITrackingRunLoopMode. By default, NSURLConnection schedules itself in NSDefaultRunLoopMode only,
- so you don't get any messages while scrolling.
scheduleInRunLoop的作用
最新推荐文章于 2018-01-31 22:49:09 发布