yichizhang / NSTextView-LineNumberView

Add line numbers to an instance of NSTextView. The line number view is implemented as a subclass of NSRulerView.
MIT License
142 stars 25 forks source link

crash when close window(memory release) #2

Open hament opened 9 years ago

hament commented 9 years ago

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)

afantree commented 8 years ago

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

hament commented 8 years ago

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

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

afantree commented 8 years ago

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