SlideShare a Scribd company logo
Computer Science Large Practical:

                                Programming with Xcode

                                               Stephen Gilmore

                                               School of Informatics


                                          Friday 19th October, 2012




Stephen Gilmore (School of Informatics)      Computer Science Large Practical   Friday 19th October, 2012   1 / 47
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
Xcode is available from the App Store




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   3 / 47
Click to install




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   4 / 47
Supply your Apple ID password




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   5 / 47
The button will change to “Installing”




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   6 / 47
Foo




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   7 / 47
Accept the License Agreement




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   8 / 47
Some components may be updated




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   9 / 47
Requires system permission




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   10 / 47
Installing ...




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   11 / 47
Installing ...




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   12 / 47
Installation complete




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   13 / 47
Welcome screen




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   14 / 47
Create a new project




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   15 / 47
Many options, including iOS projects




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   16 / 47
Choose an OS X application




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   17 / 47
Choose a command-line tool




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   18 / 47
Choose options




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   19 / 47
Choose options




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   20 / 47
Choose Foundation for Objective-C




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   21 / 47
Can choose to create a git repository




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   22 / 47
Project main screen




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   23 / 47
Project has sample “Hello World” code




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   24 / 47
Autocompletion suggests options




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   25 / 47
Autocompletion suggests options




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   26 / 47
Autocompletion suggests options




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   27 / 47
Static analysis warns about code problems




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   28 / 47
Autocompletion works on literals too




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   29 / 47
Deliberately seeding a bug, overwriting a needed value




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   30 / 47
Static analysis warns about format string errors




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   31 / 47
Fixing the format string error




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   32 / 47
Running the code (first time)




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   33 / 47
Requires authentication




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   34 / 47
Build succeeded




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   35 / 47
Output in console




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   36 / 47
Using static analysis to find errors (choose Analyze)




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   37 / 47
Errors detected: value stored to ‘s’ is never read




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   38 / 47
Xcode decides to download libraries




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   39 / 47
Xcode decides to download libraries




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   40 / 47
Decide to initialise string




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   41 / 47
Looking for appropriate init method




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   42 / 47
Looking for appropriate init method (initWithString: ?)




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   43 / 47
Using “initWithString:” with a literal is redundant




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   44 / 47
Checking documentation




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   45 / 47
Code compiles without warnings — even with Analyze




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   46 / 47
Produces expected result




Stephen Gilmore (School of Informatics)   Computer Science Large Practical   Friday 19th October, 2012   47 / 47

More Related Content

More from Stephen Gilmore

More Stochastic Simulation Examples
More Stochastic Simulation ExamplesMore Stochastic Simulation Examples
More Stochastic Simulation ExamplesStephen Gilmore
 
Testing Android apps with Robotium
Testing Android apps with RobotiumTesting Android apps with Robotium
Testing Android apps with RobotiumStephen Gilmore
 
Common Java problems when developing with Android
Common Java problems when developing with AndroidCommon Java problems when developing with Android
Common Java problems when developing with Android
Stephen Gilmore
 
Quick quiz on Objective-C
Quick quiz on Objective-CQuick quiz on Objective-C
Quick quiz on Objective-C
Stephen Gilmore
 
Working with databases in Android
Working with databases in AndroidWorking with databases in Android
Working with databases in Android
Stephen Gilmore
 
Crash Course in Objective-C
Crash Course in Objective-CCrash Course in Objective-C
Crash Course in Objective-C
Stephen Gilmore
 
SELP: Debugging, AVDs and Manifests
SELP: Debugging, AVDs and ManifestsSELP: Debugging, AVDs and Manifests
SELP: Debugging, AVDs and Manifests
Stephen Gilmore
 
The Stochastic Simulation Algorithm
The Stochastic Simulation AlgorithmThe Stochastic Simulation Algorithm
The Stochastic Simulation Algorithm
Stephen Gilmore
 
Beginning Android Development
Beginning Android DevelopmentBeginning Android Development
Beginning Android Development
Stephen Gilmore
 
Computer Science Large Practical coursework
Computer Science Large Practical courseworkComputer Science Large Practical coursework
Computer Science Large Practical coursework
Stephen Gilmore
 
Software Engineering Large Practical coursework
Software Engineering Large Practical courseworkSoftware Engineering Large Practical coursework
Software Engineering Large Practical coursework
Stephen Gilmore
 
Introduction to the CSLP and the SELP
Introduction to the CSLP and the SELPIntroduction to the CSLP and the SELP
Introduction to the CSLP and the SELP
Stephen Gilmore
 
Fixing errors in Android Java applications
Fixing errors in Android Java applicationsFixing errors in Android Java applications
Fixing errors in Android Java applicationsStephen Gilmore
 
Feedback on Part 1 of the Individual Practical
Feedback on Part 1 of the Individual PracticalFeedback on Part 1 of the Individual Practical
Feedback on Part 1 of the Individual Practical
Stephen Gilmore
 
Creating and working with databases in Android
Creating and working with databases in AndroidCreating and working with databases in Android
Creating and working with databases in Android
Stephen Gilmore
 
Continuing Android development
Continuing Android developmentContinuing Android development
Continuing Android developmentStephen Gilmore
 
Project management for the individual practical
Project management for the individual practicalProject management for the individual practical
Project management for the individual practicalStephen Gilmore
 
Beginning Android development
Beginning Android developmentBeginning Android development
Beginning Android developmentStephen Gilmore
 
CS/SE Individual practical - DDMS and AVD
CS/SE Individual practical - DDMS and AVDCS/SE Individual practical - DDMS and AVD
CS/SE Individual practical - DDMS and AVDStephen Gilmore
 

More from Stephen Gilmore (19)

More Stochastic Simulation Examples
More Stochastic Simulation ExamplesMore Stochastic Simulation Examples
More Stochastic Simulation Examples
 
Testing Android apps with Robotium
Testing Android apps with RobotiumTesting Android apps with Robotium
Testing Android apps with Robotium
 
Common Java problems when developing with Android
Common Java problems when developing with AndroidCommon Java problems when developing with Android
Common Java problems when developing with Android
 
Quick quiz on Objective-C
Quick quiz on Objective-CQuick quiz on Objective-C
Quick quiz on Objective-C
 
Working with databases in Android
Working with databases in AndroidWorking with databases in Android
Working with databases in Android
 
Crash Course in Objective-C
Crash Course in Objective-CCrash Course in Objective-C
Crash Course in Objective-C
 
SELP: Debugging, AVDs and Manifests
SELP: Debugging, AVDs and ManifestsSELP: Debugging, AVDs and Manifests
SELP: Debugging, AVDs and Manifests
 
The Stochastic Simulation Algorithm
The Stochastic Simulation AlgorithmThe Stochastic Simulation Algorithm
The Stochastic Simulation Algorithm
 
Beginning Android Development
Beginning Android DevelopmentBeginning Android Development
Beginning Android Development
 
Computer Science Large Practical coursework
Computer Science Large Practical courseworkComputer Science Large Practical coursework
Computer Science Large Practical coursework
 
Software Engineering Large Practical coursework
Software Engineering Large Practical courseworkSoftware Engineering Large Practical coursework
Software Engineering Large Practical coursework
 
Introduction to the CSLP and the SELP
Introduction to the CSLP and the SELPIntroduction to the CSLP and the SELP
Introduction to the CSLP and the SELP
 
Fixing errors in Android Java applications
Fixing errors in Android Java applicationsFixing errors in Android Java applications
Fixing errors in Android Java applications
 
Feedback on Part 1 of the Individual Practical
Feedback on Part 1 of the Individual PracticalFeedback on Part 1 of the Individual Practical
Feedback on Part 1 of the Individual Practical
 
Creating and working with databases in Android
Creating and working with databases in AndroidCreating and working with databases in Android
Creating and working with databases in Android
 
Continuing Android development
Continuing Android developmentContinuing Android development
Continuing Android development
 
Project management for the individual practical
Project management for the individual practicalProject management for the individual practical
Project management for the individual practical
 
Beginning Android development
Beginning Android developmentBeginning Android development
Beginning Android development
 
CS/SE Individual practical - DDMS and AVD
CS/SE Individual practical - DDMS and AVDCS/SE Individual practical - DDMS and AVD
CS/SE Individual practical - DDMS and AVD
 

Recently uploaded

Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 

Recently uploaded (20)

Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 

Getting started with Xcode

  • 1. Computer Science Large Practical: Programming with Xcode Stephen Gilmore School of Informatics Friday 19th October, 2012 Stephen 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 Store Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 3 / 47
  • 4. Click to install Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 4 / 47
  • 5. Supply your Apple ID password Stephen 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. Foo Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 7 / 47
  • 8. Accept the License Agreement Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 8 / 47
  • 9. Some components may be updated Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 9 / 47
  • 10. Requires system permission Stephen 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 complete Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 13 / 47
  • 14. Welcome screen Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 14 / 47
  • 15. Create a new project Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 15 / 47
  • 16. Many options, including iOS projects Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 16 / 47
  • 17. Choose an OS X application Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 17 / 47
  • 18. Choose a command-line tool Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 18 / 47
  • 19. Choose options Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 19 / 47
  • 20. Choose options Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 20 / 47
  • 21. Choose Foundation for Objective-C Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 21 / 47
  • 22. Can choose to create a git repository Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 22 / 47
  • 23. Project main screen Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 23 / 47
  • 24. Project has sample “Hello World” code Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 24 / 47
  • 25. Autocompletion suggests options Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 25 / 47
  • 26. Autocompletion suggests options Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 26 / 47
  • 27. Autocompletion suggests options Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 27 / 47
  • 28. Static analysis warns about code problems Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 28 / 47
  • 29. Autocompletion works on literals too Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 29 / 47
  • 30. Deliberately seeding a bug, overwriting a needed value Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 30 / 47
  • 31. Static analysis warns about format string errors Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 31 / 47
  • 32. Fixing the format string error Stephen 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 authentication Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 34 / 47
  • 35. Build succeeded Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 35 / 47
  • 36. Output in console Stephen 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 read Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 38 / 47
  • 39. Xcode decides to download libraries Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 39 / 47
  • 40. Xcode decides to download libraries Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 40 / 47
  • 41. Decide to initialise string Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 41 / 47
  • 42. Looking for appropriate init method Stephen 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 redundant Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 44 / 47
  • 45. Checking documentation Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 45 / 47
  • 46. Code compiles without warnings — even with Analyze Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 46 / 47
  • 47. Produces expected result Stephen Gilmore (School of Informatics) Computer Science Large Practical Friday 19th October, 2012 47 / 47