I am having a difficult time getting an NSCalendarDate to show up in my NSTableView.
the third column of the tableview is the date column, and I am fairly certain I have the NSDateFormmater applied to that column correctly. In IB I dragged the NSDateFormatter from the palette to the third column header of the table view. when I test the Interface, it beeps at me when I thry to put a "jklk" in but when I enter a number, a date (1/1/01) or "today" it accepts that.
the code i am using to pass info to the tableview is below.
The line that causes the program to crash is
else if ([ident isEqual:I_DATE])
--> return [[taskListMArray objectAtIndex:row] dueDate];
I was under the impression that if you pass an NSCalendarDate pointer (dueDate) to the tableview and the cells have the date formatter it should just display the date in the format you set in IB.
dueDate is defined in a header as:
task.h:
NSCalendarDate *dueDate;
and the method is simple:
task.h:
- (NSCalendarDate *)dueDate;
task.m:
- (NSCalendarDate *)dueDate
{
return dueDate;
}
Any obvious or not so obvious mistakes that an NS, OSX, Obj-C newbie is making here?
is the problem most likely with the objectValueForTableColumn: function or the way I have imp'd dueDate?
All help is appreciated!
Kai
- (id)tableView

NSTableView *)tv
objectValueForTableColumn

NSTableColumn *)tc
row

int)row
{
unsigned int prior;
NSString *ident = [tc identifier];
prior = [[taskListMArray objectAtIndex:row]priority];
if (tv == taskTableView)
{
if ([ident isEqual:I_DONE])
return [NSNumber numberWithInt:[[taskListMArray objectAtIndex:row] done]];
else if ([ident isEqual:I_DATE])
return [[taskListMArray objectAtIndex:row] dueDate];
else if ([ident isEqual:I_PRIORITY])
{
if (prior == 3)
return @"High";
if (prior == 2)
return @"Normal";
if (prior == 1)
return @"Low";
}
else if ([ident isEqual:I_SHORTDESC])
return [[taskListMArray objectAtIndex:row]shortDesc];
}
return @"";
}