• 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 Problems - re-post
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextStorage Problems - re-post


  • Subject: NSTextStorage Problems - re-post
  • From: "Josh Ferguson" <email@hidden>
  • Date: Tue, 25 Jun 2002 11:20:38 -0500
  • Thread-topic: NSTextStorage Problems - re-post

I posted this question last week, but didn't get a response, so I'm hoping somebody who knows a lot about the text objects system will notice this and have some pointers.

I'm creating a text editor that supports syntax coloring. To do this, I've sub-classed NSTextStorage to store additional attributes. When I open a blank document everything seems fine. When I type the first character, my textView calls the various functions (-fixAttributesInRange, -replaceCharactersInRange:withString...), but the problem I have is in -attributesAtIndex:effectiveRange:. This method gets called 4 times, with the first three times executing succesfully (it's getting the attribute at index 0). The fourth time, it tries to get the attribute for index 39, and since there is no index 39, it screws the whole system up. Just for kicks, I put a catch in to just return if the index is greater than the length of the string, and it just repeatedly calls attributesAtIndex, and effectively freezes the application. Anyone have any ideas what could be going wrong here???

Thanks!

Josh
_______________________________________________
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.

  • Prev by Date: NSTableView philosophy question.. (MVC Pattern) where to put the dataSource delegate?
  • Next by Date: Re: NSView and rectangle management
  • Previous by thread: Re: NSTableView philosophy question.. (MVC Pattern) where to put the dataSource delegate?
  • Next by thread: Re: NSTextStorage Problems - re-post
  • Index(es):
    • Date
    • Thread