Find Menu?

I want to enable the Find menu in my app for use in a standard text view. The items don’t have connections by default, and when I tried to connect the menu item to the text view, I didn’t see any appropriate methods. Since the menu is a default part of the Edit menu, there must be something very simple I’m missing. What is it?

I saw a thread on this when I did a search, but it linked me to, which no longer exists.


The NSTextView object has a method called “performFindPanelAction:” which handles most of the menu items actions for you. The method can be found in the actions for the “First Responder” object in IB. You have to connect each menu item manually by holding down the control key and dragging from the menu item to the First Responder object. Then, select the target/action “performFindPanelAction:” and connect it. For most of the menu items in the find submenu, there is one other step you must take. According to the docs, when an object calls the performFindPanelAction method, it looks at the tag for that item, and uses that to determine which find action to perform. For each menu item, set its tag (towards the bottom of the ‘attributes’ pane in the inspector window) to its required value…
1 - Find…
2 - Find Next
3 - Find Previous
4 - Use Selection for Find
See the “find panel constants” section for the list where these value came from. The only one that is not like this is the “Jump to Selection” item, which instead needs to be attached to the “centerSelectionInVisibleArea:” method, and does not need to have any particular tag value.

That should do it,

Jobu! Jobu! Jobu! Jobu! :smiley:

Thanks, man! I don’t know how you found this out, but thanks so much!

Macscripter, does indeed, rock!