Re: Help with data browser
Re: Help with data browser
- Subject: Re: Help with data browser
- From: Dave Rosborough <email@hidden>
- Date: Mon, 5 Sep 2005 08:16:20 -0700
By all means, NO! You don't need to use Core Data to do this. As I
think someone suggested, just do it the old way - make a class that
conforms to the NSTableDataSource protocol. You'll need to implement
exactly two data source methods.
Assuming that you've got something like this:
#define NUM_COLS = 5
#define NUM_ROWS = 5000
int myArray[NUM_COLS][NUM_ROWS];
Just set up a table in interface builder with the appropriate number
of columns, connect the table view's data source to an object in
which you've defined the following methods:
- (int)numberOfRowsInTableView:(NSTableView *)aTableView
{
return NUM_ROWS;
}
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:
(NSTableColumn *)aTableColumn
(int):rowIndex
{
int colIndex = [[aTableView tableColumns]
indexOfObject:aTableColumn];
return [NSNumber numberWithInt:myArray[colIndex][rowIndex]];
}
Done.
TTYL
DaveR
On 5-Sep-05, at 7:58 AM, Bob Sabiston wrote:
Hello again,
I'm looking at the Core Data programming guide, and it really
doesn't seem to be what I am looking for. Like, I don't care about
persistence and undo or any of those things.
I have an array of floats, say array[5][5000]. I just want to put
that information in a table that can be scrolled so that I am able
to look at all of it. Is it really necessary to go through all of
this managed object stuff to get that into a Cocoa window? Carbon
is not looking so difficult after all!
Thanks for any advice
Bob
_______________________________________________
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