Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Formatter for NSTableView




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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >RE: Formatter for NSTableView (From: "Peter Karlsson" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.