Re: Tracking multiple NSURLConnections
Re: Tracking multiple NSURLConnections
- Subject: Re: Tracking multiple NSURLConnections
- From: Alexander Spohr <email@hidden>
- Date: Tue, 29 Jun 2010 18:23:22 +0200
Not sure if I understood the problem. But why not just use the NSURLConnection objects themselves?
The delegate methods give you the corresponding NSURLConnection.
atze
Am 29.06.2010 um 18:00 schrieb email@hidden:
> I have and app that needs to send out multiple connection attempts. NSURLConnection doesn't appear to allow one to distinguish between connections. I found a couple of posts at cocoabuilder that provide some guidance, but I wanted to ask about my approach. I'm writing for 10.6, so I'm using a category on NSURLConnection combined with associative references. The methods in the category are below, but basically I associate an integer with a given connection and track the connections using that. So, short of subclassing or following what I've found in the archives, does this make sense? Am I missing any details that might cause this to fail?
> Thanks
>
>
> -(void)setTagValue:(NSNumber*)val{
>
> objc_setAssociatedObject(self, @selector(tagValue), val, OBJC_ASSOCIATION_RETAIN);
> }
>
> -(NSNumber *) tagValue {
>
> return objc_getAssociatedObject(self, @selector(tagValue));
> }
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden