1

I'm trying to add link attributes to the NSMutableString of a NSTextView.

Since I only want to add the link to the visible text with the text view, I observe the NSScrollView for scrolling changes with the NSViewBoundsDidChangeNotification notification of the NSScrollView's contentView.

When the notification selector is called, I add a link attribute to the string. But unfortunately the notification is called immediately after I've added the link attribute to the string. And this goes on and on forever - since adding the link changes the view's bounds.

Is there anything I miss here? Is this a Lion only issue?

brutella
  • 1,597
  • 13
  • 26

1 Answers1

0

That sounds like normal behavior. Why not just subclass NSScrollView, override scrollWheel: and post your own notification?

Francis McGrew
  • 7,264
  • 1
  • 33
  • 30
  • scrollWheel: is only called when the user scrolls the wheel of the mouse or with the trackpad. I think scrollClipView:toPoint: would be better. – brutella Feb 11 '12 at 15:35