NSTextView-LineNumberView icon indicating copy to clipboard operation
NSTextView-LineNumberView copied to clipboard

crash when close window(memory release)

Open hament opened this issue 10 years ago • 3 comments

hello , in my project, i used NSTextView-LineNumberView, the textview is on a NSWindowController,when i close the window , the app must crash, and the Xcode log a location is "[NSTextview rulerView: willSetClientView:]"

actually, the rulerView: willSetClientView: method should be invoke by NSrulerview.

Here is my demo : http://yunpan.cn/cc99hU9TwQ8Wz (提取码/fetch code:8fce)

hament avatar Jul 25 '15 16:07 hament

@hament hello, I meet the same problem,too. Did you solve it ?

afantree avatar Aug 23 '16 07:08 afantree

@afantree en ,you can subclass a NSTextview, and add a empty method

  • (void)rulerView:(NSRulerView *)aRulerView willSetClientView:(NSView *)newClient{ }

in it to avoid the crash problem. However I use another tool ASKLineNumberView in github to replace LineNumberRulerView

hament avatar Aug 25 '16 08:08 hament

@hament yeah,Thanks for your method ,I solve it .

afantree avatar Aug 26 '16 12:08 afantree