[Q] Weird problem with the NSTableView
[Q] Weird problem with the NSTableView
- Subject: [Q] Weird problem with the NSTableView
- From: JongAm Park <email@hidden>
- Date: Wed, 06 Dec 2006 19:57:10 -0800
Hello.
Recently I tried to write a small program which shows the string
encoding conversion table.
it should be easy and quick program.
However I ran into a strange problem. I didn't have this problem before. So, it looks more strange.
For explanation, i would like to write some code here.
@interface ConversionController : NSObject
{
IBOutlet NSTableView *conversionTable;
NSArray *encodingStringArray_CF;
NSArray *description;
NSArray *availability;
NSMutableArray *encodingStringArray_NSString;
NSMutableArray *encodingStringArray_IANA;
}
@end
@implementation ConversionController
- (id) init
{
NSLog( @"init()");
encodingStringArray_CF = [NSArray arrayWithObjects:@"Jenny", @"Tom",
nil];
encodingStringArray_CF = [NSArray
arrayWithObjects:@"kCFStringEncodingMacRoman",
@"kCFStringEncodingMacJapanese",
@"kCFStringEncodingMacChineseTrad",
@"kCFStringEncodingMacKorean",
......., nil];
return self;
}
- (int)numberOfRowsInTableView:(NSTableView *)aTableView
{
return [encodingStringArray_CF count];
}
- (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex
{
id theColArray, theValue;
// NSLog( @"rowIndex = %d, count = %d\n", rowIndex,
[encodingStringArray_CF count] );
// NSParameterAssert(rowIndex >= 0 && rowIndex <
[encodingStringArray_CF count] );
// if( [[aTableColumn identifier] isEqualToString:@"CF_COL"] )
NSString *theString = [encodingStringArray_CF objectAtIndex:rowIndex];
return theString;
}
Just for testing, the NSTableView contains only 1 column.
What is strange is that it crashes in the
tableView:objectValueForTableColumn:row.
After displaying some rows, it crashes. In debugger mode, it just jumps
into the debugger,
showing "objc_msgSend" in a call tree view.
Do I miss something?
I know that my question is somewhat vague, but it is the only
information I can get from the debugger.
It doesn't show any more specific error message.
Thank you.
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=++=+=+=+=
JongAm Park Home : http://my.dreamwiz.com/jongam
Blog : http://jongampark.blogspot.com
H.P)213-820-8943 AIM/iChat : JongAm
_______________________________________________
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