I have a lot of connections going when my app starts, so I wanna put them on background threads so I can make new connections other than the starting connections before they all complete.
Below, threadedRequest:
is a method that's starting a NSURLConnection, but when I call performSelectorInBackground:withObject:
in the if
clause, the connection starts, but never finishes. The else
clause works fine and returns data from the connection
if (background)
{
[self performSelectorInBackground: @selector(threadedRequest:) withObject: args];
}
else
{
[self performSelector: @selector(threadedRequest:) onThread: [NSThread mainThread] withObject: args waitUntilDone: NO];
}