Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Damn sisters :-)



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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.