Re: Strange Problem Printing Multiple NSTextViews
Re: Strange Problem Printing Multiple NSTextViews
- Subject: Re: Strange Problem Printing Multiple NSTextViews
- From: Kyle Sluder <email@hidden>
- Date: Wed, 06 Feb 2013 10:27:25 -0800
On Wed, Feb 6, 2013, at 09:41 AM, Keary Suska wrote:
> The issue is in the above lines, where I release the NSTextStorage. I was
> assuming that the NSTextView would retain the text storage, which
> certainly must be the case in certain situations, but clearly isn't the
> case when one is constructing the text system by hand. I.e., when you let
> NSTextView construct its own text system, it retains the related objects,
> but when you use the -initWithFrame:textContainer: method, it does not.
This is explained in the Cocoa Text Architecture Guide:
http://developer.apple.com/library/mac/#documentation/TextFonts/Conceptual/CocoaTextArchitecture/TextSystemArchitecture/ArchitectureOverview.html#//apple_ref/doc/uid/TP40009459-CH7-SW11
It's also the reason you can't set up a zeroing weak reference to an
NSTextView; NSTextView checks its own retain count for magic values and
deallocates itself if it reaches those values.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden