Alex Rivera | Logout

NSButtonCell vs NSButton

Asked 2011-05-24T15:25:52.437
9

I've been reading through the Apple documentation about NSButtons and cells and I really can't seem to understand the distinction between the two. Adding to this complexity, it looks like both of them have a large overlap of methods like setTitle: etc. and I'm not sure which ones I should use.

Can anyone explain what the basic differences are?

Thanks,
Teja

Edit
Report

1 Answer

-2

NSButton Cell has alot more cutomizable options for drawing and behaviour. The differences are better seen in the classes they inherit from (NSButtonCell inherits from the ActionCell class, while the NSButton inherits from the NSControl class.

Take a look at the documentation better:

http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSButton_Class/Reference/Reference.html

http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSButtonCell_Class/Reference/Reference.html

You should choose based on how you want the buttons to be drawn and behave. If its a simple button you want, use NSButton.

answered 2011-05-24T15:41:54.203

Your Answer