• 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: 4.5 question - _holdMe array trick
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 4.5 question - _holdMe array trick


  • Subject: Re: 4.5 question - _holdMe array trick
  • From: "b.bum" <email@hidden>
  • Date: Thu, 21 Aug 2003 13:28:04 -0700

On Thursday, August 21, 2003, at 2:16 , Adam Chan wrote:
Do you mean some release(retain) issue?
If so yes adding an object to the NSArray(NSDictionary) will increase the
object's retain count by 1 thus prevent it from being released, but you can
simply put [myObj retain] instead directly (and remember to release it
later).

Not if it is a pure Java object that has been proxied to the other side of the bridge. In that case, it is generally the proxy that is being released inappropriately.


Shoving the object-- whether sourced from ObjC or Java-- into a mutable array is a good way to consistently ensure that the retain count has been bumped.

This works quite well in Cocoa/Java to ensure things like notification observers or controller objects stick around.

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

References: 
 >4.5 question - _holdMe array trick (From: "Robert A. Decker" <email@hidden>)
 >Re: 4.5 question - _holdMe array trick (From: "Adam Chan" <email@hidden>)

  • Prev by Date: Re: 4.5 question - _holdMe array trick
  • Next by Date: Re: 4.5 question - _holdMe array trick
  • Previous by thread: Re: 4.5 question - _holdMe array trick
  • Next by thread: Re: 4.5 question - _holdMe array trick
  • Index(es):
    • Date
    • Thread