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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to