• 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
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Formatter for NSTableView


  • Subject: Re: Formatter for NSTableView
  • From: Larry Fransson <email@hidden>
  • Date: Thu, 21 Oct 2004 12:56:04 -0700


On Oct 21, 2004, at 11:08, Peter Karlsson wrote:

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.

[[[[TableviewOutlet tableColumns] objectAtIndex:0] dataCell]
setFormatter:myFormatterOutlet];

You're trying to apply a formatter to an NSArray. Note that NSArray has no such method -setFormatter. The compiler probably already told you that.

You can't actually apply a formatter to a table view all at once. You must apply it to each column's data cell individually:

[[[myTableView tableColumnWithIdentifier:identifierString] dataCell] setFormatter:someFormatter];

If you want to apply the formatter to every column in the table, you could use [myTableView tableColumns] and iterate over the items in the returned array, applying the formatter in a similar way.

Larry Fransson
Seattle, WA

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

  • Prev by Date: Toolbar Item Validation in a Panel
  • Next by Date: Re: Increasing size of NSImage by adding padding
  • Previous by thread: RE: Formatter for NSTableView
  • Next by thread: text fields
  • Index(es):
    • Date
    • Thread