• 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
Retaining a NSURL and retaining its -path
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Retaining a NSURL and retaining its -path


  • Subject: Retaining a NSURL and retaining its -path
  • From: John Love <email@hidden>
  • Date: Sat, 12 Sep 2009 12:43:42 -0400

In my controller, one of my instance variables is a NSURL and I retain it because I pass it to a 2nd controller. In my second controller, I extract [myURL path] and look at it in a secondary thread loop and everything works fine. I began to think if I could eliminate that call to [myURL path] every time through that loop I would save "some" time.

My first attempt was to pass that NSURL in the same manner and then place the extracted [myURL path] into an instance variable of the 2nd controller. Okay so far .. and then I assumed that if myURL was retained in the 1st controller, then "naturally" its NSString -path was also retained .. but it crashed with "release message sent to a already released object" (or something like that). Only when I extracted the -path *and* retained it before I stored it as an instance variable of the 2nd controller did it work.

Basic question: if a parent object is retained, why isn't each sibling component object of that parent retained??

John Love
Touch the Future! Teach!



_______________________________________________

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


  • Follow-Ups:
    • Re: Retaining a NSURL and retaining its -path
      • From: Ken Thomases <email@hidden>
    • Re: Retaining a NSURL and retaining its -path
      • From: Jens Alfke <email@hidden>
    • Re: Retaining a NSURL and retaining its -path
      • From: BJ Homer <email@hidden>
  • Prev by Date: Re: AffineTransform
  • Next by Date: Re: Retaining a NSURL and retaining its -path
  • Previous by thread: Re: Cocoa-dev Digest, Vol 6, Issue 1304
  • Next by thread: Re: Retaining a NSURL and retaining its -path
  • Index(es):
    • Date
    • Thread