• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSMutableURLRequest weirdness!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: NSMutableURLRequest weirdness!
  • Next by Date: Re: NSMutableURLRequest weirdness!
  • Previous by thread: Re: NSMutableURLRequest weirdness!
  • Next by thread: NSToolbarItem bindings crash
  • Index(es):
    • Date
    • Thread