RE: NSLayoutManagers
RE: NSLayoutManagers
- Subject: RE: NSLayoutManagers
- From: "Josh Ferguson" <email@hidden>
- Date: Fri, 9 Aug 2002 14:52:24 -0500
- Priority: normal
- Thread-topic: NSLayoutManagers
I don't think this is the case, but I'll explain later...first the code I'm using:
...
[[textView layoutManager] replaceTextStorage:[[SyntextStorage alloc] init]];
...
storage = [textView textStorage];
[self updateView];
[storage setDelegate:self];
...
When the app first opens a document (whether it be blank or filled with text), the appropriate calls for fixAttributes are made, and the layout manager array is filled with just one layout manager. As soon as I type something into the text view, however, it calls fixAttributes (appropriately), where I make the call to get the array of layout managers, and that's when I get an invalid member. I believe it's something rooted deeper in the text system than that.
Josh Ferguson
-----Original Message-----
From: Brian Webster [
mailto:email@hidden]
Sent: Friday, August 09, 2002 2:41 PM
To: email@hidden
Cc: Josh Ferguson
Subject: Re: NSLayoutManagers
My first inclination is that something is going awry in the way
you're setting up your text system hierarchy. Like perhaps
you're calling -[NSLayoutManager setTextStorage:] instead of
-[NSLayoutManager replaceTextStorage:] or something like that.
Could you post the code where you do your setup?
On Friday, August 9, 2002, at 02:09 PM, cocoa-dev-
email@hidden wrote:
>
I have some questions about the relationship between
>
NSTestStorage and NSLayoutManagers. I have a pretty basic text
>
editor in which I've implemented a concrete sub-class of
>
NSTextStorage. In order to keep the coloring of the text up to
>
date, I have chosen to send an
>
invalidateDisplayForCharacterRange: message to the
>
layoutmanager(s) from within the text storage. This seems
>
pretty straight forward, as I just call [self layoutManagers]
>
to create an array of layout managers. My first inclination
>
was to place that in a for loop and send the message to every
>
layout manager in the array. For some reason, however, the
>
array is getting an invalid member, which is causing a run time
>
error because "NSSubTextStorage" (which is NOT my subclass)
>
does not respond to invalidateDisplayForCharacterRange. My
>
answer to this is to simply send the message to the first
>
layout manager. Does anyone know of any problems that might
>
arise from just sending it to the first member of the array? !
>
I don't have multiple layouts in my view, so I shouldn't
>
actually have to worry about multiple layout managers, but the
>
Cocoa text system is so cryptic that I'm never confident that
>
it won't try and pull something on me behind the scenes ;).
>
Also, does anyone have any clue why I'd be getting an invalid
>
member in my layout manager array?
--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
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.