Re: A couple of NSTable questions
Re: A couple of NSTable questions
- Subject: Re: A couple of NSTable questions
- From: Stéphane Sudre <email@hidden>
- Date: Wed, 30 Jul 2003 18:42:59 +0200
Le mercredi, 30 juil 2003, ` 17:52 Europe/Paris, Mike Brinkman a icrit :
My method looks like this:
- (id)tableView:(NSTableView *)tableView
objectValueForTableColumn:(NSTableColumn *)tableColumn
row:(int)row
{
NSString *identifier = [tableColumn identifier];
ToDoList *listItem = [myToDoList objectAtIndex:row];
return [listItem valueForKey:identifier];
}
So I'm not sure how I'd return an attributed string to display into a
table.
You can't return two different things, can you?
If you have a NSFormatter attached to this column, go for the subclass
of your NSDateFormatter.
Likewise, I've also got an NSFormatter attached to the due date column
of my
table, can you have more than one?
No (in fact you change it for every row in the column but it's not a
good idea).
How would you apply it so that every item
in the row changes based upon the date?
- (NSAttributedString *)attributedStringForObjectValue:(id)anObject
withDefaultAttributes:(NSDictionary *)attributes
file:///System/Library/Frameworks/Foundation.framework/Versions/C/
Resources/English.lproj/Documentation/Reference/ObjC_classic/Classes/
NSFormatter.html#//apple_ref/occ/cl/NSFormatter
On 7/30/03 10:22 AM, "Stiphane Sudre" <email@hidden> wrote:
Le mercredi, 30 juil 2003, ` 16:17 Europe/Paris, Mike Brinkman a
icrit :
Next objective I wanted to do was to make any appointments ending
within 7
days to show up in red. I know that if I was just going to draw a
string in
a view, all I would do is something like this:
[...]
For instance in:
- (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex
{
}
You can return a NSAttributedString.
Or you could write a NSFormatter subclass.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.