• 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
Re: Damn sisters :-)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Damn sisters :-)


  • Subject: Re: Damn sisters :-)
  • From: Matt Rollefson <email@hidden>
  • Date: Mon, 10 Dec 2001 11:01:51 -0800

You don't understand -- this *is* the cleaner way. In fact, you should generally use accessor methods inside a class's implementation as well -- that way you don't have to worry if you later change the implementation of your data storage from, say, an instance variable to a value stored in a dictionary or some such. While it does seem like (and is) a bit of extra overhead, it's a cleaner model to clearly encapsulate the information inside the class vs the information exposed outside of it.

Rollie


On Monday, December 10, 2001, at 10:11 AM, Riccardo Santato wrote:

You are not supposed to have access to another class's data. Create
accessor methods to access the data. For instance,
- (id)myInstanceVariable
{
return myInstanceVariable;
}

I've already thought about this option but I supposed I was rather stupid
to use a "dummy" function just to pass a variable... I hoped there was a
cleaner way :-))

--
Riccardo Santato
www.riccardosantato.com
_______________________________________________
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.


References: 
 >Re: Damn sisters :-) (From: Riccardo Santato <email@hidden>)

  • Prev by Date: Re: logout and auto-login
  • Next by Date: [ANN] New NSTask sample
  • Previous by thread: Re: Damn sisters :-)
  • Next by thread: Re: Damn sisters :-)
  • Index(es):
    • Date
    • Thread