FROM : Ondra Cada
DATE : Tue Nov 19 14:21:56 2002
On Tuesday, Nov 19, 2002, at 07:49 Europe/Prague, Peter wrote:
> I was not aware of NSAttributedString, after studying
> NSAttributedString, I tried another way and it works too. Instead of
> caching NSAttributedString or doing willDisplayCell delegate, I
> convert NSString to NSAttributedString for display.
>
> 1) change NSString type to NSAttributedString
> 2) willDisplayCell delegate method
> 3) convert NSString to NSAttributedString for tableView display
>
> I wonder which one is the best way ?
I don't quite follow how the difference betwixt (1) and (3) was meant.
Nevertheless, the thing is quite simple:
- if your data source sends attributed strings *anyway* (either since
they are cached in some mutable array or whatever, or they are
generated on the fly), that's that;
- otherwise (ie. if the data source sends NSStrings or other objects),
use the willDisplayCell delegate method.
---
Ondra Cada
OCSoftware: <email_removed> http://www.ocs.cz
private <email_removed> http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Tue Nov 19 14:21:56 2002
On Tuesday, Nov 19, 2002, at 07:49 Europe/Prague, Peter wrote:
> I was not aware of NSAttributedString, after studying
> NSAttributedString, I tried another way and it works too. Instead of
> caching NSAttributedString or doing willDisplayCell delegate, I
> convert NSString to NSAttributedString for display.
>
> 1) change NSString type to NSAttributedString
> 2) willDisplayCell delegate method
> 3) convert NSString to NSAttributedString for tableView display
>
> I wonder which one is the best way ?
I don't quite follow how the difference betwixt (1) and (3) was meant.
Nevertheless, the thing is quite simple:
- if your data source sends attributed strings *anyway* (either since
they are cached in some mutable array or whatever, or they are
generated on the fly), that's that;
- otherwise (ie. if the data source sends NSStrings or other objects),
use the willDisplayCell delegate method.
---
Ondra Cada
OCSoftware: <email_removed> http://www.ocs.cz
private <email_removed> http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| Peter | Nov 18, 12:07 | |
| j o a r | Nov 18, 13:14 | |
| Joseph Jones | Nov 18, 17:56 | |
| Ondra Cada | Nov 18, 19:28 | |
| Peter | Nov 19, 07:49 | |
| Ondra Cada | Nov 19, 14:21 |






Cocoa mail archive

