Last Revision:
Version 1.2, 2012-04-05
Removed all compiler warnings, upgraded for Xcode 4.3/Lion.
(Full Revision History)
Build Requirements:
Xcode 4.3, Mac OS X 10.7.x or later
Runtime Requirements:
Mac OS X 10.5.x or later

ButtonMadness is a Cocoa application that demonstrates how to use the various type of buttons. It demonstrates two approaches: creating buttons using Interface Builder and creating the same buttons using code.

Apple recommends that you design your application with Interface Builder whenever possible. However, you may need to create controls in code when the makeup of your UI is not fully known until runtime. This sample shows both approaches as it gives you an idea of the "magic" that goes on behind the scenes in Interface Builder: creating the standard UI elements, affecting their behavior and attributes, and setting their target/action connections. As an added bonus, a special Objective-C category is introduced to show how to un-select all segments of an NSSegmentedControl.