Re: Two Newbie Questions
Re: Two Newbie Questions
- Subject: Re: Two Newbie Questions
- From: Sherm Pendley <email@hidden>
- Date: Wed, 16 Feb 2011 18:15:52 -0500
On Wed, Feb 16, 2011 at 5:56 PM, Bruce Cresanta <email@hidden> wrote:
>
> I have an NSTableView set up to a datasource of a single array. When I run my code, I get two columns (the default in IB) instead of just one with the data duplicated in each column. I only want one column, how best to achieve this?
Select the table view in IB, then change its "Columns" attribute in
the "Attributes" pane of the inspector panel.
> NSButton can be set up to perform a selector in IB on click. How do you set Target/Action for a button in code?
It's pretty rare that you'd need to, so I have to ask the obligatory
question: Are you sure you want to do that? If you tell us what you're
trying to accomplish, we might be able to help you find a way to do it
that doesn't involve setting up the target & action in code.
That said:
[theButton setTarget:aTarget]; // Set the target to nil to send an
action to the responder chain
[theButton setAction:@selector(doAction:)]; // Don't forget the colon...
sherm--
--
Cocoa programming in Perl:
http://camelbones.sourceforge.net
_______________________________________________
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