On Jan 10, 2012, at 10:14 PM, James Merkel wrote:

>  the default NSParagraphStyle is being applied to my string.

To be precise, a NSParagraphStyle is being applied to your attributed string. 
The NSString does not contain any formatting information.

When you copy rich text, say from TextEdit, you place two sets of data on the 
pasteboard: the rich text data with the NSParagraphStyle and font information, 
and plain text data, which is just the characters. When you paste into a 
document, the receiving app chooses the item on the pasteboard that it wants to 
use. A code editor might prefer the plain text version, whereas a word 
processor would prefer the rich text version.

If you want the text to line up neatly in an app that takes plain text from the 
pasteboard, you probably want to align everything using spaces, as Jens said. 
If you want the text to align in an app that uses rich text, you should use 
tabs and define their location using NSParagraphStyle. To handle both 
possibilities, you need to manage what gets put on the pasteboard. If you are 
using NSTextView, there are some pasteboard methods available for you to 
override.

Ross
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to