Note that there are some explanatory texts on larger screens.

plurals
  1. POAFNetworking and NSURLConnection on main thread
    text
    copied!<p><img src="https://i.stack.imgur.com/9pYkz.png" alt="enter image description here"></p> <p>EDIT: The highlighted row in the screenshot is what I have a problem with, why is <code>NSURLConnection</code> running on <code>[NSThread main]</code> when I'm not calling it, <code>AFNetworking</code> is.</p> <p>I'm using AFNetworking for my project, but when running Time Profiler in Instruments I'm seeing a lot of activity on the main thread for NSURLConnection, I have a feeling this is not what I want.</p> <p>My method is</p> <pre><code>- (void)parseArticles { NSMutableArray *itemsToParse = [[FMDBDataAccess sharedDatabase] getItemsToParse]; NSMutableArray *operations = [[NSMutableArray alloc] init]; for (Post *p in itemsToParse) { NSMutableString *strURL = [NSMutableString new]; [strURL appendString:@"http://xxxxxxxxxxxxxxxxxxxxxx.php?url="]; [strURL appendString:[p href]]; NSURL *url = [NSURL URLWithString:strURL]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; [[ParserClient sharedInstance] registerHTTPOperationClass:[AFHTTPRequestOperation class]]; [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { dispatch_async(loginParseQueue, ^{ Parser *parse = [[Parser alloc] init]; [parse parseLink:responseObject rowID:[p rowID]]; }); } failure:^(AFHTTPRequestOperation *operation, NSError *error) { NSLog(@"%@",error); }]; [operations addObject:operation]; } NSOperationQueue *operationQueue = [[NSOperationQueue alloc] init]; [operationQueue setMaxConcurrentOperationCount:3]; [operationQueue addOperations:operations waitUntilFinished:NO]; } </code></pre> <p>Why would AFNetworking be using the main thread? and how do I fix it.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload