• 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
Re: NSTextStorage subclass
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextStorage subclass


  • Subject: Re: NSTextStorage subclass
  • From: Rachel Blackman <email@hidden>
  • Date: Fri, 27 Jan 2006 10:21:44 -0800

- If you use the standard NSTextStorage in your program instead of your subclass, does that work? If not, it would clearly indicate a problem elsewhere. Otherwise the problem might be in your subclass.
- If you just have one view displaying the data from your subclass of NSTextStorage, does that work? If not, that might indicate a problem in the way multiple views have been set up.

I should have elaborated; it's specifically /blocks/ of text that are shared between multiple views, not the entire storage. Sharing one NSTextStorage between two views is easy enough, yes. Just that when I'm dealing with data that could reach 24 megabytes in size or so (*whimper*), being able to share memory of those blocks as many places as I can seems useful.


(Especially as this situation calls for me having a single NSMutableArray with every line/block of text once, in order, regardless of what view it gets eventually put into. If I have to store them anyway, I figured using those in the views directly could keep my memory footprint down.)

That said, using a standard NSTextStorage (as the NSTextView is set up with by default) in my test program works fine. Using even just the generic 'this always works' subclass of NSTextStorage from Apple's own docs or the Cocoadev wiki, immediately I get the crash on edited:...

Hence my thought that I'm doing something fundamentally wrong. Or that there's a step besides [[textView layoutManager] replaceTextStorage:newStorage] that I'm somehow missing. :)

I suppose in a pinch I /can/ go back to just standard NSTextStorage, but I tried that before and the memory footprint was horrible. So I'm going back and trying to solve both that issue, and the 'laying this out again every time' performance issue. (Truncating the history is not an overall option, in this case.)
_______________________________________________
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
References: 
 >NSTextStorage subclass (From: Rachel Blackman <email@hidden>)
 >Re: NSTextStorage subclass (From: Ali Ozer <email@hidden>)

  • Prev by Date: Re: Universal Binary & Mac OS 10.1
  • Next by Date: Re: BEEP protocol
  • Previous by thread: Re: NSTextStorage subclass
  • Next by thread: CFPreferences
  • Index(es):
    • Date
    • Thread