• 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
NSTextStorage setAttributedString problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextStorage setAttributedString problems


  • Subject: NSTextStorage setAttributedString problems
  • From: Will Thimbleby <email@hidden>
  • Date: Fri, 20 Sep 2002 11:39:43 +0100

Hi,

I'm using setAttributedString on a NSTextStorage from a NSTextView, so that I can directly set the html displayed. However this only seems to work when the html I replace is smaller than the one I replace it with.

My Code:

attr = [[[NSAttributedString alloc] initWithHTML:html documentAttributes:NULL] autorelease];
[[textBox textStorage] beginEditing];
[[textBox textStorage] setAttributedString:attr];
[[textBox textStorage] endEditing];

Error message when data replaced with smaller data: Data size 4096->3101.

*** NSRunStorage, _NSBlockNumberForIndex(): index (4094) beyond array bounds (3101)

Is there a solution to this?
Or is there a better way to set the html of a NSTextView?

I'm using MOSX 10.1

Cheers, Will
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSTextStorage setAttributedString problems
      • From: Jeremy Dronfield <email@hidden>
  • Prev by Date: Re: searching a Unicode string in a text
  • Next by Date: Re: searching a Unicode string in a text
  • Previous by thread: Re: NSView coordinate System
  • Next by thread: Re: NSTextStorage setAttributedString problems
  • Index(es):
    • Date
    • Thread