Re: Two Newbie Questions
Re: Two Newbie Questions
- Subject: Re: Two Newbie Questions
- From: Bruce Cresanta <email@hidden>
- Date: Wed, 16 Feb 2011 16:17:58 -0700
Hi Sherm,
About my second question. I've written a custom control that currently has and icon tracked by a tracking area to perform an action. I would like to change it to a regular button without setting up my custom control to be compatible with IB.
Thanks,
Bruce
On Feb 16, 2011, at 4:15 PM, Sherm Pendley wrote:
> 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