• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTableView Data Source problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTableView Data Source problems


  • Subject: NSTableView Data Source problems
  • From: David Kopec <email@hidden>
  • Date: Mon, 28 Jan 2002 18:10:15 -0500

It seems no matter what I put in for return values of these two methods, my applications will crash when the tableview is clicked on or the window's resize box is clicked on. The table does however load the data correctly into the table. Ignore the NSLogging, that's just debug stuff. Even if I just remove all the code all together from the methods and just have the first return something arbitrary like 15 and the second return @"test" it crashes in the above way. It doesn't have to do with the rest of my application either, since taking out the data source methods results in smooth riding. The crash is a SigBus 10.

- (int)numberOfRowsInTableView:(NSTableView *)aTableView
{
if ([array count] > 2)
{
NSLog(@"returning [array count] - 2 for number of rows in table view");
return [array count] - 2;
}
else
{
NSLog(@"returning 0 for number of rows in table view");
return 0;
}
}

- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
{
if ([aTableColumn identifier] == @"Track")
{
NSLog(@"Returning row index");
return [NSString stringWithFormat:@"%d", rowIndex];
}
else
{
NSLog(@"Returning objectatindex in array");
return [array objectAtIndex:rowIndex+2];
}
}


  • Follow-Ups:
    • Re: NSTableView Data Source problems
      • From: Marinus van der Lugt <email@hidden>
  • Prev by Date: Re: Milliseconds Function?
  • Next by Date: Initting NSArray with NSString's -propertyList method
  • Previous by thread: RE: Springs and struts with splitview
  • Next by thread: Re: NSTableView Data Source problems
  • Index(es):
    • Date
    • Thread