Computer Science Large Practical:                                Programming with Xcode                                   ...
News         There will be no CSLP lecture next week. The next CSLP lecture will         be on Friday 2nd November.       ...
Xcode is available from the App StoreStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 1...
Click to installStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   4...
Supply your Apple ID passwordStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th Octo...
The button will change to “Installing”Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday ...
FooStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   7 / 47
Accept the License AgreementStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th Octob...
Some components may be updatedStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th Oct...
Requires system permissionStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October...
Installing ...Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   11 ...
Installing ...Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   12 ...
Installation completeStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 201...
Welcome screenStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   14 ...
Create a new projectStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012...
Many options, including iOS projectsStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19...
Choose an OS X applicationStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October...
Choose a command-line toolStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October...
Choose optionsStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   19 ...
Choose optionsStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   20 ...
Choose Foundation for Objective-CStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th ...
Can choose to create a git repositoryStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 1...
Project main screenStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012 ...
Project has sample “Hello World” codeStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 1...
Autocompletion suggests optionsStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th Oc...
Autocompletion suggests optionsStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th Oc...
Autocompletion suggests optionsStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th Oc...
Static analysis warns about code problemsStephen Gilmore (School of Informatics)   Computer Science Large Practical   Frid...
Autocompletion works on literals tooStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19...
Deliberately seeding a bug, overwriting a needed valueStephen Gilmore (School of Informatics)   Computer Science Large Pra...
Static analysis warns about format string errorsStephen Gilmore (School of Informatics)   Computer Science Large Practical...
Fixing the format string errorStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th Oct...
Running the code (first time)Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th Octob...
Requires authenticationStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2...
Build succeededStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   35...
Output in consoleStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   ...
Using static analysis to find errors (choose Analyze)Stephen Gilmore (School of Informatics)   Computer Science Large Pract...
Errors detected: value stored to ‘s’ is never readStephen Gilmore (School of Informatics)   Computer Science Large Practic...
Xcode decides to download librariesStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19t...
Xcode decides to download librariesStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19t...
Decide to initialise stringStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th Octobe...
Looking for appropriate init methodStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19t...
Looking for appropriate init method (initWithString: ?)Stephen Gilmore (School of Informatics)   Computer Science Large Pr...
Using “initWithString:” with a literal is redundantStephen Gilmore (School of Informatics)   Computer Science Large Practi...
Checking documentationStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 20...
Code compiles without warnings — even with AnalyzeStephen Gilmore (School of Informatics)   Computer Science Large Practic...
Produces expected resultStephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, ...
Upcoming SlideShare
Loading in …5
×

Getting started with Xcode

1,983 views

Published on

Installing Xcode and writing your first simple program. Shows the usefulness of static analysis.

Published in: Education
  • Be the first to comment

  • Be the first to like this

Getting started with Xcode

  1. 1. Computer Science Large Practical: Programming with Xcode Stephen Gilmore School of Informatics Friday 19th October, 2012Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 1 / 47
  2. 2. News There will be no CSLP lecture next week. The next CSLP lecture will be on Friday 2nd November. As of Tuesday, Xcode is now available on all the Open Access Lab Apple Macs in the Main Library in George Square. If you are developing on the Macs in the library you do not need to install Xcode. We see first how to install Xcode if you are working on your (Mac) laptop.Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 2 / 47
  3. 3. Xcode is available from the App StoreStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 3 / 47
  4. 4. Click to installStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 4 / 47
  5. 5. Supply your Apple ID passwordStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 5 / 47
  6. 6. The button will change to “Installing”Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 6 / 47
  7. 7. FooStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 7 / 47
  8. 8. Accept the License AgreementStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 8 / 47
  9. 9. Some components may be updatedStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 9 / 47
  10. 10. Requires system permissionStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 10 / 47
  11. 11. Installing ...Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 11 / 47
  12. 12. Installing ...Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 12 / 47
  13. 13. Installation completeStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 13 / 47
  14. 14. Welcome screenStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 14 / 47
  15. 15. Create a new projectStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 15 / 47
  16. 16. Many options, including iOS projectsStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 16 / 47
  17. 17. Choose an OS X applicationStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 17 / 47
  18. 18. Choose a command-line toolStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 18 / 47
  19. 19. Choose optionsStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 19 / 47
  20. 20. Choose optionsStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 20 / 47
  21. 21. Choose Foundation for Objective-CStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 21 / 47
  22. 22. Can choose to create a git repositoryStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 22 / 47
  23. 23. Project main screenStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 23 / 47
  24. 24. Project has sample “Hello World” codeStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 24 / 47
  25. 25. Autocompletion suggests optionsStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 25 / 47
  26. 26. Autocompletion suggests optionsStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 26 / 47
  27. 27. Autocompletion suggests optionsStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 27 / 47
  28. 28. Static analysis warns about code problemsStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 28 / 47
  29. 29. Autocompletion works on literals tooStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 29 / 47
  30. 30. Deliberately seeding a bug, overwriting a needed valueStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 30 / 47
  31. 31. Static analysis warns about format string errorsStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 31 / 47
  32. 32. Fixing the format string errorStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 32 / 47
  33. 33. Running the code (first time)Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 33 / 47
  34. 34. Requires authenticationStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 34 / 47
  35. 35. Build succeededStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 35 / 47
  36. 36. Output in consoleStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 36 / 47
  37. 37. Using static analysis to find errors (choose Analyze)Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 37 / 47
  38. 38. Errors detected: value stored to ‘s’ is never readStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 38 / 47
  39. 39. Xcode decides to download librariesStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 39 / 47
  40. 40. Xcode decides to download librariesStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 40 / 47
  41. 41. Decide to initialise stringStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 41 / 47
  42. 42. Looking for appropriate init methodStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 42 / 47
  43. 43. Looking for appropriate init method (initWithString: ?)Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 43 / 47
  44. 44. Using “initWithString:” with a literal is redundantStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 44 / 47
  45. 45. Checking documentationStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 45 / 47
  46. 46. Code compiles without warnings — even with AnalyzeStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 46 / 47
  47. 47. Produces expected resultStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 47 / 47

×