• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSText/NSAttributedString alignLeft: and rtf
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSText/NSAttributedString alignLeft: and rtf


  • Subject: NSText/NSAttributedString alignLeft: and rtf
  • From: Tony Rennier <email@hidden>
  • Date: Tue, 30 May 2006 16:47:45 -0400


I have a problem that I can't seem to futz my way through. I have been working with a code base that dates back to the NeXT days trying to correct a problem that was introduced with the release a Tiger. It seems that the following commands all produce NSData objects (streams) with any and all AlignLeft tags removed.


NSData *rtfData = [[myNSTextView RTFFromRange:NSMakeRange(0, [[myNSTextView string] length])] copy];

NSData *rtfData = [[[myNSTextView textStorage]
dataFromRange:NSMakeRange(0, [[myNSTextView textStorage] length])
documentAttributes:[NSDictionary dictionaryWithObject: NSRTFTextDocumentType forKey:@"DocumentType"]
error:NULL] copy];


NSData *webArchiveData = [[[myNSTextView textStorage]
dataFromRange:NSMakeRange(0, [[myNSTextView textStorage] length])
documentAttributes:[NSDictionary dictionaryWithObject:NSWebArchiveTextDocumentType forKey:@"DocumentType"]
error:NULL] copy];


NSData *wordMLData = [[[myNSTextView textStorage]
dataFromRange:NSMakeRange(0, [[myNSTextView textStorage] length])
documentAttributes:[NSDictionary dictionaryWithObject: NSWordMLTextDocumentType forKey:@"DocumentType"]
error:NULL] copy];


NSData *htmlData = [[[myNSTextView textStorage]
dataFromRange:NSMakeRange(0, [[myNSTextView textStorage] length])
documentAttributes:[NSDictionary dictionaryWithObject: NSHTMLTextDocumentType forKey:@"DocumentType"]
error:NULL] copy];


Where myNSTextView is a simple NSTextView with rich text some of which is left justified.
AlignCenter and AlignRight tags come through as expected.


The original code, which worked fine before the release of Tiger, is the first entry above.
Any ideas on what changed and how I can get this working again are greatly appreciated.


Thanks,

- Tony

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSText/NSAttributedString alignLeft: and rtf
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: Changing from Java to OBJ-C
  • Next by Date: Re: NSError naming convention?
  • Previous by thread: [ANN] -- Atimi seeks Cocoa programmer
  • Next by thread: Re: NSText/NSAttributedString alignLeft: and rtf
  • Index(es):
    • Date
    • Thread