FROM : Jerry LeVan
DATE : Thu Nov 07 21:11:11 2002
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_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Thu Nov 07 21:11:11 2002
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_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| Jerry LeVan | Nov 7, 20:22 | |
| Jerry LeVan | Nov 7, 21:11 | |
| Stéphane Sudre | Nov 8, 15:18 | |
| Jonathan E. Jackel | Nov 8, 16:36 |






Cocoa mail archive

