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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to