Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mkristain

macrumors regular
Original poster
Aug 18, 2011
115
0
hi please help me to resolve this.

i am using a NSTableView and a IKImageBrowserView,when i inserting different type of images in IKImageBrowser,i update the its counter in NSTableView,using below method,

but some times application gives EXC_BAD_ACCESS.

so please guide me.

my code is

Code:
- (id) tableView:(NSTableView *)pTableViewObj objectValueForTableColumn:(NSTableColumn *)pTableColumn row:(int)pRowIndex
{
        id record, value;
			
	record = [nsDataObject objectAtIndex:pRowIndex];
			
			
	value = [record objectForKey:[pTableColumn identifier]];
			
			
	return value;

}

- (void)tableView:(NSTableView *)pTableViewObj setObjectValue:(id)pObject forTableColumn:(NSTableColumn *)pTableColumn row:(int)pRowIndex
{
     [nsDataObject replaceObjectAtIndex:pRowIndex withObject:pObject];
			
}


what wrong here?

please help.
 
Last edited:
How long have you been doing this?

Look at who is calling what at the time of the crash.
Look at what object is calling the crash.

Then use your brain. And NSLog statements.

This is about the most stupid help request that you could post here. You have a Mac, the running application, a running debugger, all the tools you need. We don't.
 
here its point out in debugger :

Code:
#0	0x9581d1ca in ___CFBasicHashFindBucket1
#1	0x958254cc in CFBasicHashFindBucket
#2	0x95825393 in CFDictionaryGetValue
#3	0x00007f17 in -[MyTableController tableView:objectValueForTableColumn:row:] at MyTableController.m:2261
#4	0x92216417 in -[NSTableView _dataSourceValueForColumn:row:]
#5	0x921933ea in -[NSTableView preparedCellAtColumn:row:]
#6	0x921ad8bc in -[NSTableView _drawContentsAtRow:column:withCellFrame:]
#7	0x921ac92a in -[NSTableView drawRow:clipRect:]
#8	0x921ac362 in -[NSTableView drawRowIndexes:clipRect:]
#9	0x921aad3b in -[NSTableView drawRect:]
#10	0x921a082a in -[NSView _drawRect:clip:]
 
here its point out in debugger :

Code:
#0	0x9581d1ca in ___CFBasicHashFindBucket1
#1	0x958254cc in CFBasicHashFindBucket
#2	0x95825393 in CFDictionaryGetValue
#3	0x00007f17 in -[MyTableController tableView:objectValueForTableColumn:row:] at MyTableController.m:2261
#4	0x92216417 in -[NSTableView _dataSourceValueForColumn:row:]
#5	0x921933ea in -[NSTableView preparedCellAtColumn:row:]
#6	0x921ad8bc in -[NSTableView _drawContentsAtRow:column:withCellFrame:]
#7	0x921ac92a in -[NSTableView drawRow:clipRect:]
#8	0x921ac362 in -[NSTableView drawRowIndexes:clipRect:]
#9	0x921aad3b in -[NSTableView drawRect:]
#10	0x921a082a in -[NSView _drawRect:clip:]

Great. Now think about what is happening. Who wrote CFDictionaryGetValue? Do you think it contains bugs that crash sometimes, or do you think something is wrong with the data it is given? Which data is it given? Which dictionary, and which key? What happens if you try to display the dictionary or the key? Why the hell don't you store the key into a local variable, and add an NSLog statement that prints its contents, and another NSLog statement that prints the contents of the dictionary?
 
some times its point out here?

Code:
0x920b4c18 in -[NSCell setObjectValue:]
0x9219347f in -[NSTableView preparedCellAtColumn:row:]
0x921ad8bc in -[NSTableView _drawContentsAtRow:column:withCellFrame:]
0x921ac92a in -[NSTableView drawRow:clipRect:]
0x921ac362 in -[NSTableView drawRowIndexes:clipRect:]
0x921aad3b in -[NSTableView drawRect:]

please guide me to resolve this.

thanks.
 
some times its point out here?

Code:
0x920b4c18 in -[NSCell setObjectValue:]
0x9219347f in -[NSTableView preparedCellAtColumn:row:]
0x921ad8bc in -[NSTableView _drawContentsAtRow:column:withCellFrame:]
0x921ac92a in -[NSTableView drawRow:clipRect:]
0x921ac362 in -[NSTableView drawRowIndexes:clipRect:]
0x921aad3b in -[NSTableView drawRect:]

please guide me to resolve this.

thanks.

So where did you add NSLog statements?
The bug is not where it crashes; the bug happens a lot earlier.
NSLog statements put into the right places will help you finding out _where_ things start going wrong. So where have you added NSLog statements so far?

And did you do anything with the previous advice, which was exactly meant to _guide_ you?

What about just the first question: Who wrote CFDictionaryGetValue? Can you answer that?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.