| School of Physics |
|
| Physics Home | Study here | Our Teaching | Our Research | Our Centres | News | Work here | EMPS |
Back to top
Tips for using XCodeRunning XCode for the first time
Creating a project
Note:To insert a hash sign (#) type Alt-3 (i.e. press and hold down the "Alt" key and press "3", just like using the shift key). Also notice that it's the "Alt" key, not the "Apple" key. Errors and warningsWhen you compile the system may flag up two types of problems: errors and warnings. ErrorsErrors are indicated by Red circles and denote code that is not valid C. The program will not compile or run.WarningsWarnings are indicated by Amber triangles. Technically, this code is valid and system will compile and run it. But it probably means you have made a mistake so fix it. Seeing what they areError and warning alerts appear in two places: in the left-hand margin by the side of the individual lines with problems and at the bottom right of the window. To view all errors and warnings at once, click on the red circle or amber triangle at the bottom right of the page. To view an individual error or warning, move your mouse over the relevant warning sign at the left of the code line and wait a couple of seconds. Fixing themIn general, fix problems starting with the first one as this may also fix later problems. One of the most potentially confusing errors is "Parse error" (or"Syntax error")which means you have made a mistake in your punctuation. It will tell you the character ("token") that it saw when it was expecting to see something else. |