Re: Problem with dynamic reconfiguration of a TableView?
Re: Problem with dynamic reconfiguration of a TableView?
- Subject: Re: Problem with dynamic reconfiguration of a TableView?
- From: Jerry LeVan <email@hidden>
- Date: Thu, 07 Nov 2002 15:11:11 -0500
Arrgh,
Never mind... I corrected the typos "tmpArray" should be colArray...
It seems to be working Ok, I undoubtably have a bunch of memory leaks to
track down now ;(
--Jerry
>
Hi,
>
>
I am writing a small application that reads a data file, it then determines
>
the number of columns to add to a tableview, builds a represention of the
>
file and then adds the columns to a table view that was created with no
>
columns.
>
>
The data shows up in the table automagically.
>
>
The problems appear when I try to repeat the process with another file...
>
Application crashes via a seg violation.
>
>
I enter the routine and delete the columns from the table view using many
>
variations of code similar to:
>
// Try to determine if we have been here before if so then clean up...
>
colArray =[NSArray arrayWithArray: [tableView tableColumns]];
>
NSLog(@"tmp array %@",colArray);
>
if([colArray count]) {
>
for(i=0; i< [tmpArray count] ; i++){
>
[tableView removeTableColumn: [tmpArray objectAtIndex:i]];
>
}
>
NSLog(@"Finished releasing columns");
>
// [colArray release];
>
// [tableView tile];
>
// NSLog(@"Released tmpArray");
>
>
}
>
>
I then get the file name from the user and build the data array.
>
I then add new columns
>
>
Of course the data array is used in the tableView delegate methods.
>
>
Taint clear to me what a suitable protocol might be for switching the number
>
of columns and supplying an data source that reflects the new file.
>
>
Thanks for any insight...
>
>
--Jerry
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.