• 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: dealloc methods not being called?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dealloc methods not being called?


  • Subject: Re: dealloc methods not being called?
  • From: "Kyle Sluder" <email@hidden>
  • Date: Fri, 21 Mar 2008 19:43:18 -0400

On Fri, Mar 21, 2008 at 5:54 PM, Randall Meadows <email@hidden> wrote:
>  > I'm thinking I have overused "retain" on a multitude of properties I
>  > have created.  What's a good rule of thumb for using "retain" versus
>  > "assign"?  Things I explicitly allocate get "retain", whereas
>  > objects I get from other objects get "assign"?  That doesn't seem to
>  > cover all the bases.  What about objects instantiated via IBOutlet
>  > connections?  Readonly?  Assign?
>
>  I'm still interested in knowing this, if anyone's got any tips or
>  pointers.  The ObjC 2.0 doc doesn't really seem to go into much detail
>  about this.

Think about the Objective-C memory management rules.  If, when writing
your mutator, you would use -retain, use retain.  If you would use
assignment, use assign.  If you would create a copy, use copy.  It's
really that simple.  Primarily, assign is used for delegate
relationships (to avoid retain cycles) and primitives.

--Kyle Sluder
_______________________________________________

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

References: 
 >dealloc methods not being called? (From: Randall Meadows <email@hidden>)
 >Re: dealloc methods not being called? (From: Randall Meadows <email@hidden>)

  • Prev by Date: Re: populate a custom sub-class with data from bindings - SOLVED
  • Next by Date: Re: Cocoa Database Connection
  • Previous by thread: Re: dealloc methods not being called?
  • Next by thread: Re: dealloc methods not being called?
  • Index(es):
    • Date
    • Thread