Re: NSTableView Questions
Re: NSTableView Questions
- Subject: Re: NSTableView Questions
- From: Corbin Dunn <email@hidden>
- Date: Mon, 27 Oct 2008 11:25:21 -0700
On Oct 27, 2008, at 10:54 AM, Carmen Cerino Jr. wrote:
Howdy,
My goal is to create an upload dialog. Like most upload/download
dialogs, I
am going to use a table view to display my information. Eventually I
will
need to create my own custom NSCell in order to represent an item
being
uploaded, so I can represent multiple pieces of information in one
cell. I
am currently having difficulty getting my NSTableView setup in order
to
accept this custom NSCell. I first tried doing the usual, and adding
an
NSTableView in IB. I can't seem to figure out how to make IB
recognize my
custom NSCell class so it appears in the drop down list for the cell
in my
table's column.
I first comment checking out this demo:
http://developer.apple.com/samplecode/PhotoSearch/
Chances are, you need to subclass NSTextFieldCell instead of NSCell --
try that, and then you will be able to set the custom class in IB.
This is a known problem with IB.
Next I tried adding an NSTableView to my view in my code. I
was able to successfully set the cell for my table's column to my
custom
cell, but I was not able to figure out how to go about getting the
TableView
to size properly. In other words, I would set my the ScrollView that
enclosed the TableView to be 400x400, but the TableView would size
to fit
the data instead of matching the size of its container. I thought
setting
the TableView's size to match that of the ScrollView would fix the
problem,
but for some reason it doesn't.
NSTableView should do it automatically; instead of creating the table
in code, can you put it into a nib? That will save you a lot of
trouble. If you are using a nib, then something else may be setup wrong.
corbin
_______________________________________________
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