• 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: Wrong type of button in IB?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wrong type of button in IB?


  • Subject: Re: Wrong type of button in IB?
  • From: Julio Cesar Silva dos Santos <email@hidden>
  • Date: Thu, 16 Jun 2005 16:34:19 -0300

You should declare myButton the way Interface Builder does with every outlet it creates:

IBOutlet id myButton;

The id type allows you to connect any control to it.

Julio Cesar Santos
email@hidden
eMac 1GHz ComboDrive
640MB RAM
Linux User #359973

On Jun 16, 2005, at 16:20, Mark Dawson wrote:

Changing "myButton" to NSTableView* just changes the error to "myButton must be of type NSTableView". Note that IB DOES allow me to connect up "myButton" to the "outletThatWorks" method variable…

Mark
te:
I've created a new IB nib, and hooked up an outley ("outletThatWorks")t; however, when I added a new outlet (myButton), I can't connect to it (control drag from my controller to an NSTableView object)--I get an error "myButton must be of type NSButton") What does that mean, as "myButton" IS an NSButton type?

@interface myController : NSWindowController {
@private
IBOutlet NSButton* outletThatWorks; // checkbox
IBOutlet NSButton* myButton; // NSTableView

}

You've declared myButton to be an NSButton, so when you try to tell IB to connect it to something that's *not* an NSButton, it naturally complains. An NSTableView is not a kind of NSButton.

You need to declare the outlet appropriately for the type of object you want it to connect to, and you should probably name it appropriately while you're at it, something like this:

IBOutlet NSTableView* myTable; // NSTableView

--Andy
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Wrong type of button in IB?
      • From: mmalcolm crawford <email@hidden>
    • Re: Wrong type of button in IB?
      • From: Andy Lee <email@hidden>
References: 
 >Wrong type of button in IB? (From: Mark Dawson <email@hidden>)
 >Re: Wrong type of button in IB? (From: Andy Lee <email@hidden>)
 >Re: Wrong type of button in IB? (From: Mark Dawson <email@hidden>)

  • Prev by Date: Using DO to talk to a process running as root
  • Next by Date: Re: Wrong type of button in IB?
  • Previous by thread: Re: Wrong type of button in IB?
  • Next by thread: Re: Wrong type of button in IB?
  • Index(es):
    • Date
    • Thread