Re: Re: Tracking multiple NSURLConnections
Re: Re: Tracking multiple NSURLConnections
- Subject: Re: Re: Tracking multiple NSURLConnections
- From: email@hidden
- Date: Tue, 29 Jun 2010 16:36:44 +0000
And maybe store the connection objects in a container? An NSArray or maybe
an NSDictionary?
On Jun 29, 2010 11:23am, Alexander Spohr <email@hidden> wrote:
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