I do this using NSURLConnection, creating their properties and then checking which one:
@property (nonatomic,retain) NSURLConnection *myConnection; @property (nonatomic,retain) NSURLConnection *mySecondConnection;
then in the delegate:
- (void)connectionDidFinishLoading:(NSURLConnection *)connection{ if (connection == myConnection){ //do something } if (connection == mySecondConnection){ // do something else } }
You can pass NSURLRequest to the connection:
self.myConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
source share