Changing color to text in a tableview

  • Hi,

    How can I, in an easy way, change the color of the text in a cell (or a
    row) in a tableView?

    The best way would be if I could go to the datasource, and change the
    strings with something like:

    NSString * aString;
    [aString setColor:[NSColor redColor]];

    but infortunally there is no such method...

    Is there a similar way this can be done?

    Best regards,
    Eivind Andersen
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • Have a look at NSAttributedString.

    You can return a NSAttributedString instead of a NSString from your
    data source.

    On Monday, October 27, 2003, at 03:04 PM, Eivind Andersen wrote:

    > Hi,
    >
    > How can I, in an easy way, change the color of the text in a cell (or
    > a row) in a tableView?
    >
    > The best way would be if I could go to the datasource, and change the
    > strings with something like:
    >
    > NSString * aString;
    > [aString setColor:[NSColor redColor]];
    >
    > but infortunally there is no such method...
    >
    > Is there a similar way this can be done?
    >
    > Best regards,
    > Eivind Andersen
    > _______________________________________________
    > cocoa-dev mailing list | <cocoa-dev...>
    > 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 | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
previous month october 2003 next month
MTWTFSS
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Go to today