Hello everybody, I am moving my first steps both with url connections and threads so bear with me if the question may result trivial. Basically I would like to execute an NSUrlConnection in a separate thread (even if this may result 'dangerous' as many documents state). Before deciding whether to adopt this solution or not I should manage to implement it first. Now the question is really simple: what is the actual code for doing that. I know that
NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
executes the download, I've tried it seems to work. I have read that
- (id)initWithTarget:(id)target selector:(SEL)selector object:(id)argument
and
+ (void)detachNewThreadSelector:(SEL)aSelector toTarget:(id)aTarget withObject:(id)anArgument
are to be used to create a new thread
Now, how to add the initWithRequest method to the thread? Both thread methods seem to accept a selector with at most one parameter. Reading the actual required code would be really appreciated.
Thank you.