Penghe Geng
Penghe Geng

Reputation: 14631

How to jump from an event handler in story board to the code

I have a "Hello" button in the main view. I have set its Touch Up Inside handler to changeGreeting() in HelloWorldViewController.m. From the Connections Inspector, I can clear see this association: enter image description here

My question is, how to jump to changeGreeting() function in the .m file from here (the story board view)?

I would expect simply clicking on that "Hello World View Controller changeGreeting:" button would bring me to the source code. But it turns out not the case.

Upvotes: 0

Views: 58

Answers (2)

atreat
atreat

Reputation: 4413

You could go to the 'Jump Bar' which is the horizontal bar at the top of the main viewer. Here change the file to the .m file and then start typing 'change' or 'greeting' to see all the methods in this file that match the filter.

Upvotes: 1

rob mayoff
rob mayoff

Reputation: 385890

There is no way (as far as I can tell) to jump directly from that panel to the changeGreeting: method.

You can press Command-Shift-O (or choose File > Open Quickly…) and type changeGreeting: (or some prefix of it) to jump to the definition.

If you want Apple to add a better way, go to https://bugreport.apple.com/ and file a feature request.

Upvotes: 1

Related Questions