• 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 Problem when clicking inside or multiple row
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTableView Problem when clicking inside or multiple row


  • Subject: NSTableView Problem when clicking inside or multiple row
  • From: Sandro Noel <email@hidden>
  • Date: Fri, 15 Dec 2006 19:38:55 -0500

Greetings.

I'm trying to work with NSTableView and i get a weird behavior.

i have a component as a Datasource that implements
- (int)numberOfRowsInTableView:(NSTableView *)aTableView;
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn: (NSTableColumn *)aTableColumn row:(int)rowIndex;
- (void)tableView:(NSTableView *)aTableView sortDescriptorsDidChange: (NSArray *)oldDescriptors;
and has a NSMutableArray inside to store the row's and each object in the array provides with the
getter functions f1-8 to fill the proper fields of the Table view.


when i add the first record to my datasource it shows up nicely into the tableView, but whenever
I click on the tableview or add a second record, i crash in objectValueForTableColumn
I get the nice assembly window, and nothing else.


my function is like this.

- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn: (NSTableColumn *)aTableColumn row:(int)rowIndex{

NSParameterAssert (rowIndex >= 0 && rowIndex < [_torrentPool count]);
// get the record
Item *record;
record = [_pool objectAtIndex:rowIndex];

if ([[aTableColumn identifier] isEqualToString:@"f1"])
return [record f1];
else if ([[aTableColumn identifier] isEqualToString:@"f2"])
return [record f2];
else if ([[aTableColumn identifier] isEqualToString:@"f3"])
return @"0";
else if ([[aTableColumn identifier] isEqualToString:@"f4"])
return [record f4];
else if ([[aTableColumn identifier] isEqualToString:@"f5"])
return [record f5];
else if ([[aTableColumn identifier] isEqualToString:@"f6"])
return [record f6];
else if ([[aTableColumn identifier] isEqualToString:@"f7"])
return [record f7];
else if ([[aTableColumn identifier] isEqualToString:@"f8"])
return [record f8];
else
return nil;
}
i'm a litle confused as to why it is crashing, is i replace the getter functions by nil, all is ok again,
if i replace the values from inside the (row)object to nil, or a representation like @"somestring" instead of the internally kept value, wich is in a dictionary everything is ok too...


can anyone see something wrong ?

thank you!
Sandro Noel.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: NSTableView Problem when clicking inside or multiple row
      • From: Sandro Noel <email@hidden>
  • Prev by Date: Re: Database Application?
  • Next by Date: View Question
  • Previous by thread: Re: Disabling checkboxes in NSTableView
  • Next by thread: Re: NSTableView Problem when clicking inside or multiple row
  • Index(es):
    • Date
    • Thread