• 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
Weird retain Issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Weird retain Issue


  • Subject: Weird retain Issue
  • From: Karl Goiser <email@hidden>
  • Date: Wed, 25 Feb 2004 09:44:34 +1100

Hello,

I wonder if anybody can explain this for me?

One object needs a reference to another object, so the first object's init method contains a line like:

instanceVariable = [parameter retain];

Fairly standard stuff. Except that running ObjectAlloc shows that the object being passed in doesn't ever get dealloc'ed. But if I change the above line to (and make no other changes to the code):

instanceVariable = parameter;
[instanceVariable retain];

The object does get dealloc'ed.


Curious...


Karl
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Weird retain Issue
      • From: Shawn Erickson <email@hidden>
  • Prev by Date: Re: NSArrayController and bindings
  • Next by Date: Re: NSArrayController and bindings
  • Previous by thread: Re: Cocoa Doc App and AppleScript Studio Support
  • Next by thread: Re: Weird retain Issue
  • Index(es):
    • Date
    • Thread