• 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: Formatter for NSTableView[Solved]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Formatter for NSTableView[Solved]


  • Subject: Re: Formatter for NSTableView[Solved]
  • From: Jonathan Jackel <email@hidden>
  • Date: Sun, 31 Oct 2004 18:11:37 -0500

If you are going to use IB to hook up outlets, you might as well do it in a way that doesn't require code.

First, make sure that IB knows about your formatter subclass. The easiest way is to drag the "h" icon in the title bar of the header's window in XCode into the nib's instances view in IB.

Then, drag a formatter to the instances view. If you've subclassed NSNumberFormatter, drag one of those.

Then, Get Info... on the formatter. Go to the custom class display. Change the class of the formatter to your subclass.

Then, select the header cell of the column you want to format. You'll probably have to click a bunch of times. Make sure the info palette shows that you have selected the header cell, not the scroll view, table view, or table column.

Then ctrl-drag from the header cell to the formatter instance and hook up the formatter outlet.

Jonathan


On Oct 21, 2004, at 2:57 PM, Peter Karlsson wrote:

It works, nice.

I just connected my controller to the formatter in IB and used this line in
awakefromnib:

[[[[soundsquidWindow_DeviceTableviewOutlet tableColumns] objectAtIndex:0]
dataCell] setFormatter:PartFieldFormatter];

Peter


Ursprungligt meddelande

Can someone please tell me what I need to do to connect my formatter to my
tableview? I have tried the following code but I can't get it to work.

[[[[soundsquidWindow_DeviceTableviewOutlet tableColumns] objectAtIndex:0]
dataCell] setFormatter:PartFieldFormatter];

Ursprungligt meddelande

Dear list!

I have a formatter for my NSTextField that works exactly as I want. It's
done by subclassing NSFormatter. Most of the work is done in
isPartialStringValid.

Can I use the same formatter for my NSTableView? So the user can edit a
row
in the table and my formatter checks every keypress?

Best regards Peter

_______________________________________________
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


_______________________________________________
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


_______________________________________________
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


_______________________________________________
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
References: 
 >RE: RE: Formatter for NSTableView[Solved] (From: "Peter Karlsson" <email@hidden>)

  • Prev by Date: Re: FW: Where to include header files - relates to last question on variable scope
  • Next by Date: drag delete from NSTableView
  • Previous by thread: RE: RE: Formatter for NSTableView[Solved]
  • Next by thread: Fuzzy string searching. String distance algorithm based on a tree technique?
  • Index(es):
    • Date
    • Thread