• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Configure a button added in IB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Configure a button added in IB


  • Subject: Re: Configure a button added in IB
  • From: Mikael Wämundson <email@hidden>
  • Date: Sun, 16 Nov 2008 11:12:49 +0100

Thanks! Works like a charm.
Didn't work at first because I put

theButton = [[NSButton alloc] init];
before the
[theButton setTitle:@"send steve money"];

When that was removed, it worked ok (and you will probably get your money).

wamund

16 nov 2008 kl. 02.48 skrev Steven Riggs:

To do it from code, add something like..
IBOutlet NSButton *theButton;
...to your .h

Instanitate your class in interface builder and then connect theButton to your button my control dragging from your class to the button.

and then use the documentation here: http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSButton_Class/Reference/Reference.html

...to learn what kind of messages you can send to it.

ex.  [theButton setTitle:@"send steve money"];

:-)

Good luck,
   Steven Riggs

On Nov 15, 2008, at 7:04 PM, Mikael Wämundson wrote:

Am a quite a newbie to Cocoa programming.
Adding and configuring a button in IB is straightforward. I understand the process of setting action and target in IB and the connection to Xcode (IBOutlet and IBAction).
But what is the approach when creating a button in IB that I then want to configure (set title, image, enabled, etc.) in Xcode? How do I reach the button from Xcode?


wamund
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
@me.com


This email sent to email@hidden



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Configure a button added in IB (From: Mikael Wämundson <email@hidden>)
 >Re: Configure a button added in IB (From: Steven Riggs <email@hidden>)

  • Prev by Date: Re: Playing around with BWToolKit
  • Next by Date: Re: Playing around with BWToolKit
  • Previous by thread: Re: Configure a button added in IB
  • Next by thread: Playing around with BWToolKit
  • Index(es):
    • Date
    • Thread