Re: Xcode-users Digest, Vol 5, Issue 558
Re: Xcode-users Digest, Vol 5, Issue 558
- Subject: Re: Xcode-users Digest, Vol 5, Issue 558
- From: Fritz Anderson <email@hidden>
- Date: Sat, 30 Aug 2008 11:51:54 -0500
On 30 Aug 2008, at 10:28 AM, Roland Silver wrote:
My project has a window created by IB with four buttons, one of
which is named "Play Piece", which I want to enable/disable. To do
that, do I need an outlet for the button? If so, I don't see one:
how do I create one?
Your controller object (which you've either instantiated in the NIB,
or set as File's Owner for the NIB) should have an outlet that points
to the button. Add an instance variable:
IBOutlet NSButton * playPieceButton;
to your controller class. (Interface Builder 2: Drag the
controller's .h flag onto the NIB window.) Control-drag from the
controller object in the NIB to the button. Accept the playPieceButton
outlet for the connection. In your application, have your controller
watch/be informed of the relevant model state, and setEnabled: as
needed.
All the watching and enabling can be done with less, and simpler, code
using bindings, but it's not a beginner technique.
— F
--
Fritz Anderson -- Xcode 3 Unleashed: Now Available -- http://x3u.manoverboard.org/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden