After you create the user interface, you need to implement the action methods that Interface Builder added to your source files. To view and edit a source file, select the file in the Project navigator (), and the file contents appear in the source editor on the right. To open the source file in a separate window, double-click the file.
To enter code, position the pointer at the desired insertion point in the file, press Return to create a new line, and begin typing. As you type in the source editor, Xcode scans your text. When you make a syntax error, Xcode marks it with a red underline or a caret (^). If an error icon appears, click it to display a message describing the issue.
When you begin typing the name of a symbol, Xcode offers inline suggestions for completing the name. Click an item in the suggestion list to select it, or use the Up Arrow and Down Arrow keys to change the selected suggestion. Press Return to accept a suggestion.
When a method or function contains parameters or arguments, code completion includes a placeholder for each. To move to the next placeholder, press Tab; to move to the previous placeholder, press Shift-Tab.
To find and replace text in the source editor, choose Find > Find and Replace (or press Option-Command-F). The search controls appear above the source file. As you type the search string in the first field, Xcode searches the file and highlights the occurrences of the string. Enter a replacement string in the second field. To replace the occurrence and find the next, click Replace. To replace all occurrences, click All.
To find strings in your entire project, choose Find > Find in Project or select the Find navigator () in the navigator area. Enter text in the search field followed by Return, and Xcode displays occurrences of the string in the entire project. Select an occurrence to view it in the editor area. To scope the search, above the text field, choose a string type and options. To find all occurrences that start with a string, choose Find > Text > Starting with. To find symbols that start with a string, choose Find > Definitions > Starting with.
To view a symbol declaration, Option-Command-click the symbol in the source editor. Xcode opens the assistant editor next to the source editor and displays the file containing the symbol declaration. To remove the assistant editor, click the close button in the upper-right corner. To navigate to a file without opening the assistant editor, Command-click the symbol. Alternatively, use the jump bar at the top of the source editor to navigate to methods and properties.
To read a description of a symbol, Option-click the symbol, and a Quick Help popover appears. To view the full documentation for a symbol, click the Declared In or More link. To dismiss a Quick Help popover, click anywhere in the source file.
To search for symbols in your project and across the system frameworks, choose File > Open Quickly (Command-Shift-O) from anywhere in your project. In the search field popover, enter text followed by Return.
Next Step: Debug your app.