What is the ways/best practices when designing elements on the mac platform in objective-c?
I looking on reading stuff for elements like
- NSButton
- NSTextField
- Gradient backgrounds
- etc
Should i really subclass all elements and draw it my self (corners, middle area, etc) or could i use some sort of nifty background-image trick.
I have been searching on google on开发者_如何学编程 stuff but did not really find anything useful (i might be searching for the wrong thing?)
Any help appreciated, thanks!
They are different theories, but I personally think subclassing is a good way for that kind of stuff.
Then you can build your application with custom components, which have additional properties, in regard to the built-in ones.
In my point of view, you'll gain a lot by creating generic subclasses, and then subclassing those subclasses with specific code.
You'll then have a kind of derivation. You can then manage backward compatibility more easily, and a change in the generic component class will reflect in all subclasses.
So in my humble opinion, just don't be afraid of subclasses for that kind of stuff.
精彩评论