Re: NSMutableURLRequest weirdness!
Re: NSMutableURLRequest weirdness!
- Subject: Re: NSMutableURLRequest weirdness!
- From: Greg Guerin <email@hidden>
- Date: Thu, 4 Jun 2009 17:19:26 -0700
Ammar Ibrahim wrote:
Excuse me for the silly question. But I'm going to be doing
hundreds of
requests, and I have GC ON, how do I create these connections and
retain
them?
Make an NSArray ivar, which you add the connections to.
This will work under GC or retain/release. GC works because there's
a reachable reference to the NSArray, which contains reachable
references to the NSURLConnections. R/R works because adding any
object to NSArray calls retain() on the object.
If you don't want the NSURLConnections to live indefinitely, you'll
have to occasionally cull the dead ones from the NSArray.
-- GG
_______________________________________________
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