Re: Copying NSTextStorage

2008-06-04 Thread Sherm Pendley
On Tue, Jun 3, 2008 at 12:51 PM, Kyle Sluder [EMAIL PROTECTED] wrote: On Tue, Jun 3, 2008 at 11:15 AM, Gordon Apple [EMAIL PROTECTED] wrote: I tried exactly that. It did nothing but a horrendous crash when I tried to type text. I couldn't even trace it. I never even got to the copy part.

Re: Copying NSTextStorage

2008-06-03 Thread Gordon Apple
I tried exactly that. It did nothing but a horrendous crash when I tried to type text. I couldn't even trace it. I never even got to the copy part. I got the same result with a totally empty subclass. Shouldn't it have worked the same?s What gives with that? On May 31, 2008, at 7:49 PM,

Re: Copying NSTextStorage

2008-06-03 Thread Kyle Sluder
On Tue, Jun 3, 2008 at 11:15 AM, Gordon Apple [EMAIL PROTECTED] wrote: I tried exactly that. It did nothing but a horrendous crash when I tried to type text. I couldn't even trace it. I never even got to the copy part. I got the same result with a totally empty subclass. Shouldn't it

Re: Copying NSTextStorage

2008-06-03 Thread Ross Carter
On Jun 3, 2008, at 12:51 PM, Kyle Sluder wrote: On Tue, Jun 3, 2008 at 11:15 AM, Gordon Apple [EMAIL PROTECTED] wrote: I tried exactly that. It did nothing but a horrendous crash when I tried to type text. I couldn't even trace it. I never even got to the copy part. I got the same

Re: Copying NSTextStorage

2008-06-03 Thread Kyle Sluder
On Tue, Jun 3, 2008 at 2:19 PM, Ross Carter [EMAIL PROTECTED] wrote: Kyle, AFAICT, NSTextStorage is the only Cocoa class deemed semiconcrete. I guess it means that you can instantiate NSTextStorage objects as if they were concrete, but you can't subclass them without special effort. Maybe a

Re: Copying NSTextStorage

2008-06-03 Thread Alastair Houghton
On 3 Jun 2008, at 19:19, Ross Carter wrote: First I will echo what Jens has said: there's a strong probability that NSAttributedString or NSMutableAttributedString will do what need. NSTextStorage adds two capabilities to NSMutableAttributedString: it communicates with one or more

Re: Copying NSTextStorage

2008-06-01 Thread Ross Carter
On May 31, 2008, at 7:49 PM, Gordon Apple wrote: apparently NSTextView will accept nothing but the original NSTextStorage -- no subclasses allowed, even without any overrides. Nope. To subclass NSTextStorage, see http://www.cocoabuilder.com/archive/message/cocoa/2002/2/5/14848

Re: Copying NSTextStorage

2008-05-31 Thread Gordon Apple
New attempt. Instead of intercepting the text key in my shape CopyWithZone, I tried the obvious thing of subclassing NSTextStorage, adding the copying/mutablecopying protocols using the same copy technique of creating a new object initialized with the original. Even without the protocols,

Re: Copying NSTextStorage

2008-05-30 Thread Gordon Apple
Yes, I did try mutable copy (which still required intercepting the text key when copying the shape). It didn't help. I inserted some test code to try to figure out why it was crashing my program. The NSTextStorage, when copied, would blow up when asking for layoutManagers. (I was

Copying NSTextStorage

2008-05-29 Thread Gordon Apple
This used to work. No more. Has something changed in NSTextStorage? In my Shape object, I have a dictionary of parameters, one being key = text with value NSTextStorage*, similar to what is done in Sketch (without the dictionary). My copyWithZone duplicated the dictionary and called

Re: Copying NSTextStorage

2008-05-29 Thread Jens Alfke
On 29 May '08, at 11:03 AM, Gordon Apple wrote: Apparently, NSTextStorage does not conform to NSCopying, even though its superclass (NSAttributedString) does. Has something changed recently with NSTextStorage that makes copy not work? Is there a reason you need to use NSTextStorage