discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setter Gettor method style


From: Pascal Bourguignon
Subject: Re: Setter Gettor method style
Date: Sun, 4 Aug 2002 00:25:24 +0200 (CEST)

> From: Alexander Malmberg <alexander@malmberg.org>
> Date: Sat, 03 Aug 2002 21:22:01 +0200
> 
> > >   - (NSString *) title {
> > >        return [[title retain] autorelease];
> > 
> > This is strictly equivalent to { return title; }
> 
> This is not true. I've fixed bugs in Pantomime caused by this.
> 
> - Alexander Malmberg

Agree.  But the case where the difference matter would not occur in my
book because I have the rule to retain all objects I need:

     NSString* title=[[stuff title]retain];
     [stuff setTitle:newTitle];
     NSLog(@"old title was %@\n",title);
     [title release];

In my  little mind, it's simplier  to have simple rules  to be applied
always without exceptions.

-- 
__Pascal_Bourguignon__                   http://www.informatimago.com/
----------------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]