Getting started with Xcode

  • 1,448 views
Uploaded on

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

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

More in: Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,448
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
30
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 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. 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. Xcode is available from the App StoreStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 3 / 47
  • 4. Click to installStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 4 / 47
  • 5. Supply your Apple ID passwordStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 5 / 47
  • 6. The button will change to “Installing”Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 6 / 47
  • 7. FooStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 7 / 47
  • 8. Accept the License AgreementStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 8 / 47
  • 9. Some components may be updatedStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 9 / 47
  • 10. Requires system permissionStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 10 / 47
  • 11. Installing ...Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 11 / 47
  • 12. Installing ...Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 12 / 47
  • 13. Installation completeStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 13 / 47
  • 14. Welcome screenStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 14 / 47
  • 15. Create a new projectStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 15 / 47
  • 16. Many options, including iOS projectsStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 16 / 47
  • 17. Choose an OS X applicationStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 17 / 47
  • 18. Choose a command-line toolStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 18 / 47
  • 19. Choose optionsStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 19 / 47
  • 20. Choose optionsStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 20 / 47
  • 21. Choose Foundation for Objective-CStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 21 / 47
  • 22. Can choose to create a git repositoryStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 22 / 47
  • 23. Project main screenStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 23 / 47
  • 24. Project has sample “Hello World” codeStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 24 / 47
  • 25. Autocompletion suggests optionsStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 25 / 47
  • 26. Autocompletion suggests optionsStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 26 / 47
  • 27. Autocompletion suggests optionsStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 27 / 47
  • 28. Static analysis warns about code problemsStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 28 / 47
  • 29. Autocompletion works on literals tooStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 29 / 47
  • 30. Deliberately seeding a bug, overwriting a needed valueStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 30 / 47
  • 31. Static analysis warns about format string errorsStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 31 / 47
  • 32. Fixing the format string errorStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 32 / 47
  • 33. Running the code (first time)Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 33 / 47
  • 34. Requires authenticationStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 34 / 47
  • 35. Build succeededStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 35 / 47
  • 36. Output in consoleStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 36 / 47
  • 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. Errors detected: value stored to ‘s’ is never readStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 38 / 47
  • 39. Xcode decides to download librariesStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 39 / 47
  • 40. Xcode decides to download librariesStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 40 / 47
  • 41. Decide to initialise stringStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 41 / 47
  • 42. Looking for appropriate init methodStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 42 / 47
  • 43. Looking for appropriate init method (initWithString: ?)Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 43 / 47
  • 44. Using “initWithString:” with a literal is redundantStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 44 / 47
  • 45. Checking documentationStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 45 / 47
  • 46. Code compiles without warnings — even with AnalyzeStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 46 / 47
  • 47. Produces expected resultStephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 47 / 47