Re: alloc/release confusion

2009-02-14 Thread mmalc Crawford
On Feb 14, 2009, at 10:56 AM, Luca Pazzerello wrote: As the documentation reports, be careful: the -retainCount unfortunately doesn't usually return values useful to the debugging. Umm, yes, that was the point of providing the link -- I'm expecting people to follow it and read... The docum

Re: alloc/release confusion

2009-02-14 Thread Luca Pazzerello
As the documentation reports, be careful: the -retainCount unfortunately doesn't usually return values useful to the debugging. --Luca C. 2009/2/14 mmalc Crawford > > On Feb 13, 2009, at 4:55 PM, Boon Chew wrote: > > Is there a way in Cocoa to find out the reference count of an object (for >> d

Re: alloc/release confusion

2009-02-14 Thread mmalc Crawford
On Feb 13, 2009, at 4:55 PM, Boon Chew wrote: Is there a way in Cocoa to find out the reference count of an object (for debugging purposes)?

Re: alloc/release confusion

2009-02-13 Thread Sherm Pendley
On Fri, Feb 13, 2009 at 7:55 PM, Boon Chew wrote: > > How do I go about knowing whether a method like show would do the retain? You don't *need* to know whether other objects retain their arguments. They follow the same rules your own objects follow, so if they do retain it, it's their responsi

Re: alloc/release confusion

2009-02-13 Thread Boon Chew
overwritten by another object later? Is there a way in Cocoa to find out the reference count of an object (for debugging purposes)? - boon --- On Fri, 2/13/09, Bryan Henry wrote: > From: Bryan Henry > Subject: Re: alloc/release confusion > To: "Boon Chew" > Cc: "

Re: alloc/release confusion

2009-02-13 Thread Bryan Henry
When you call -show, the UIAlertView is retained elsewhere (somewhere in SpringBoard's internals). It does look a bit odd, and understandably so, but the -release is correct there because you still want to relinquish your ownership of the object...the ownership you took when you sent the -a

Re: alloc/release confusion

2009-02-13 Thread Kenny Leung
It's all detailed here: http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/MemoryMgmt.html -Kenny ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact t

alloc/release confusion

2009-02-13 Thread Boon Chew
Hi all, I am very new to Cocoa programming (but have programmed in C/C++ before) and there is one thing I don't understand with alloc and release. Sometimes I see code that alloc an object and release it within the same method, even though it's clear that the object is still live and well. Fo