Re: How far with accessors?
Re: How far with accessors?
- Subject: Re: How far with accessors?
- From: The Amazing Llama <email@hidden>
- Date: Wed, 26 May 2004 13:21:20 -0700
On May 26, 2004, at 11:51 AM, Don Rainwater wrote:
>
How far should I go with using accessors to do things to instance
>
variables? For example, say I have the following:
>
>
@interface theRecord : NSObject {
>
NSString *_theString;
>
}
>
>
#pragma mark -
>
#pragma mark ACCESSORS
>
- (NSString *)theString;
>
- (void)setTheString:(NSString *)inValue;
>
>
@end
>
>
In the dealloc method for theRecord, is there any reason (standards,
>
performance, personal preference, etc.) to use
>
>
[[self theString] release];
>
>
or is
>
>
[_theString release];
>
>
fine/preferred?
I've always used [self setTheString:nil], which should cascade to any
other objects that care about theString and its state. It's been very
helpful for me, but there are certain situations where it doesn't work
(like if the dependent objects have problems dealing with nil).
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.