Re: Strong language about Cocoa and Qt.
Re: Strong language about Cocoa and Qt.
- Subject: Re: Strong language about Cocoa and Qt.
- From: Dan Sugalski <email@hidden>
- Date: Tue, 1 Jul 2003 13:30:29 -0400
At 12:58 AM +0900 7/2/03, Rich Warren wrote:
Private Methods/Variables:
I assume (though I haven't really tried) that you can hide a method (by
putting it in a category instead of in the header file), but you can't
prevent people from calling it.
Similarly you can declare a variable as private, but others can still write
code that slips around that.
The inability to really lock down my private functions and data, and keep it
away from prying and probing fingers makes me uneasy. It probably shouldn't.
After all, I'm writing applications, not libraries. But the c++/java habits
of locking down the classes is heard to break.
FWIW, I'll point out that you can't do this in C++ either. (Dunno
about Java, as I don't do Java) It's a bit of a pain, but only a bit,
to get past the language-declared lockdown stuff. I don't know if
people do it all that often, but it is reasonably simple to do. (It's
just a matter of pointer math, proper casts, and knowing your
compiler's close-to-completely-standard behavior after all...)
--
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
email@hidden have teddy bears and even
teddy bears get drunk
_______________________________________________
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.