• 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
How far with accessors?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How far with accessors?


  • Subject: How far with accessors?
  • From: Don Rainwater <email@hidden>
  • Date: Wed, 26 May 2004 14:51:12 -0400

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?


--
Don Rainwater
_______________________________________________
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.


  • Follow-Ups:
    • Re: How far with accessors?
      • From: The Amazing Llama <email@hidden>
    • Re: How far with accessors?
      • From: Ondra Cada <email@hidden>
    • Re: How far with accessors?
      • From: Joseph Heck <email@hidden>
  • Prev by Date: Re: SearchKit Sample Code? Obj-C Wrappers?
  • Next by Date: Re: C++ structs in .mm file
  • Previous by thread: Re: NSOutlineView, NSBrowserCell and Images
  • Next by thread: Re: How far with accessors?
  • Index(es):
    • Date
    • Thread