Re: Releasing Objects

2009-12-24 Thread Greg Parker
On Dec 24, 2009, at 3:16 PM, Sherm Pendley wrote: > On Thu, Dec 24, 2009 at 5:13 PM, Greg Parker wrote: >> >> More precisely, there's exactly one short-circuit check and thus only one >> selector value. Under GC, @selector(retain) == @selector(release) == >> @selector(autorelease) == @selector(

Re: Releasing Objects

2009-12-24 Thread Sherm Pendley
On Thu, Dec 24, 2009 at 7:36 PM, Joar Wingfors wrote: > > On 24 dec 2009, at 15.16, Sherm Pendley wrote: > >> Just out of curiosity, is that really a short-circuit in the >> message-passing machinery, or are all those selectors simply >> registered to point to the same IMP function? A useless bit

Re: Releasing Objects

2009-12-24 Thread Joar Wingfors
On 24 dec 2009, at 15.16, Sherm Pendley wrote: > Just out of curiosity, is that really a short-circuit in the > message-passing machinery, or are all those selectors simply > registered to point to the same IMP function? A useless bit of > knowledge for us end-users, I know, but interesting just

Re: Releasing Objects

2009-12-24 Thread Sherm Pendley
On Thu, Dec 24, 2009 at 5:13 PM, Greg Parker wrote: > > More precisely, there's exactly one short-circuit check and thus only one > selector value. Under GC, @selector(retain) == @selector(release) == > @selector(autorelease) == @selector(dealloc) == @selector(retainCount). > Happily, `return s

Re: Releasing Objects

2009-12-24 Thread Greg Parker
On Dec 24, 2009, at 12:47 AM, Ken Thomases wrote: > On Dec 24, 2009, at 2:23 AM, John Engelhart wrote: >> >> Wait, what? I could understand that under GC -retain might be nothing more >> than the equivalent of "- (id)retain { return(self); }", but -retainCount? >> Is it really "- (NSUInteger)reta

Re: Releasing Objects

2009-12-24 Thread Ken Thomases
On Dec 24, 2009, at 2:23 AM, John Engelhart wrote: > On Wed, Dec 23, 2009 at 12:05 PM, Bill Bumgarner wrote: > >> On Dec 22, 2009, at 11:49 PM, Franck Zoccolo wrote: >> >>> You said that you're using garbage collection. When using GC retain and >>> release messages do nothing, and the retain co

Re: Releasing Objects

2009-12-24 Thread John Engelhart
On Wed, Dec 23, 2009 at 12:05 PM, Bill Bumgarner wrote: > > On Dec 22, 2009, at 11:49 PM, Franck Zoccolo wrote: > > > You said that you're using garbage collection. When using GC retain and > > release messages do nothing, and the retain count is not used to > > determine when an objet can be fre

Re: Releasing Objects

2009-12-23 Thread Michael Craig
Thanks! I've got a better grip on memory management now. By the way, I'm working with GC turned off, for the sake of learning this stuff. My bad for not including that. Michael S Craig > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > P

Re: Releasing Objects

2009-12-23 Thread Greg Guerin
Michael Craig wrote: If I'm missing some key concept here, just point me in the right direction and I'll go learn it. If it's something more specific, fill me in! In ownership terms, you released the object, so you no longer own it. References to it after that point are illegal, even if t

Re: Releasing Objects

2009-12-23 Thread mmalc Crawford
On Dec 22, 2009, at 9:40 pm, Michael Craig wrote: > At the point where the tutorial discusses garbage collection (end of ch. 5), > I decided to implement the deallocation of the Converter objects created by > ConverterController's convert: method. I want the deallocation to happen > inside conver

Re: Releasing Objects

2009-12-23 Thread Bill Bumgarner
On Dec 22, 2009, at 11:49 PM, Franck Zoccolo wrote: > You said that you're using garbage collection. When using GC retain and > release messages do nothing, and the retain count is not used to > determine when an objet can be freed from memory. If -retainCount is returning 1, then he can't be us

Re: Releasing Objects

2009-12-22 Thread Franck Zoccolo
On 23/12/2009 06:40, Michael Craig wrote: > Everything else is the same as is given in the tutorial. The console shows > that the reference count of converter is 1 both before and after the > release. Why ? > You said that you're using garbage collection. When using GC retain and release message

Re: Releasing Objects

2009-12-22 Thread Bill Bumgarner
On Dec 22, 2009, at 9:40 PM, Michael Craig wrote: >NSLog(@"Reference count: %lx", (unsigned long) [converter retainCount]); >[converter release]; >NSLog(@"Reference count: %lx", (unsigned long) [converter retainCount]); If the -release is going to deallocate converter, then the subse

Re: Releasing objects causes BAD_ACCESS

2008-07-07 Thread Scott Ribe
> the connection object as well as the receivedData object are released > in the connectionDidFinishLoading delegate The sample also retains receivedData after creating the connection. Did you do that? And did you create the connection using alloc initxxx? -- Scott Ribe [EMAIL PROTECTED] http:/

Re: Releasing objects causes BAD_ACCESS

2008-07-07 Thread Randall Meadows
On Jul 7, 2008, at 3:49 PM, Randall Meadows wrote: NSZombieEnabled is a good start - http://developer.apple.com/technotes/tn2004/tn2124.html#SECFOUNDATION See also "Technical Note TN2124 - Mac OS X Debugging Magic": Heh, which now I s

Re: Releasing objects causes BAD_ACCESS

2008-07-07 Thread Randall Meadows
On Jul 7, 2008, at 3:44 PM, Jonathan del Strother wrote: On Mon, Jul 7, 2008 at 10:38 PM, Meik Schuetz <[EMAIL PROTECTED]> wrote: according to the document http://developer.apple.com/documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html the connection object as well

Re: Releasing objects causes BAD_ACCESS

2008-07-07 Thread Jonathan del Strother
On Mon, Jul 7, 2008 at 10:38 PM, Meik Schuetz <[EMAIL PROTECTED]> wrote: > Dear all, > > according to the document > > http://developer.apple.com/documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html > > the connection object as well as the receivedData object are released