Re: textStorage readFromURL does not like blanks
Re: textStorage readFromURL does not like blanks
- Subject: Re: textStorage readFromURL does not like blanks
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Mon, 20 Aug 2007 14:20:24 +0200
On 20 Aug 2007, at 09:32, Martin Wierschin wrote:
NSTextStorage *textStorage = [ textView textStorage ];
NSDictionary *dict;
[ textStorage readFromURL: fu options: nil documentAttributes:
&dict error: outError ]
There seems to be an Apple bug in reading HTML into mutable
attributed strings (eg: NSTextStorage). See:
http://www.cocoabuilder.com/archive/message/cocoa/2007/7/17/186292
You'll probably find that loading the same HTML into an immutable
attributed string will work just fine.
~Martin
My problem has disappeared after I bracketed the readFromURL thus:
[ textStorage beginEditing ];
[ textStorage readFromURL: fu options: nil documentAttributes:
&dict error: outError ]
[ textStorage endEditing ];
Why this is so, I have no idea.
And: you are right: switching to:
attributedString = [ [ NSAttributedString alloc ] initWithURL:...
[ textStorage insertAttributedString: attributedString atIndex: 0 ];
also works.
Gerriet.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden