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

PDF
Arrays in Objective-C
KEY
iPhone Development Tools
KEY
Corso Iphone in 48h
KEY
Xcode - Just do it
PDF
Introduction of Xcode
PDF
Xcode 6の新機能
PDF
Feedback on Part 1 of the CSLP
PDF
Quick quiz on Objective-C
Arrays in Objective-C
iPhone Development Tools
Corso Iphone in 48h
Xcode - Just do it
Introduction of Xcode
Xcode 6の新機能
Feedback on Part 1 of the CSLP
Quick quiz on Objective-C

Similar to Getting started with Xcode (20)

PDF
Swift Tutorial Free For You To Use Brooo
PPTX
Academic Day 2211.pptx
PDF
Extracurricular Swift
PDF
Crash Course in Objective-C
PDF
ICS3MeBook
PPTX
Austin Python Learners Meetup - Everything you need to know about programming...
PPTX
Java basics
PDF
Download Complete The Rust Programming Language 2nd Edition Steve Klabnik PDF...
PDF
Scientific Programming Clanguage Algorithms And Models In Science Luciano M B...
PPTX
01 computer programming
PDF
Feedback on Part 1 of the Software Engineering Large Practical
PDF
C++ progrmming language
PDF
(Ebook) The Rust Programming Language, Second Edition by Steve Klabnik, Carol...
PPTX
Class 27: Pythonic Objects
PDF
Cbj 2 1_2005_callief_ida
PDF
Introduction to Computer Science Using Python and Pygame
PDF
Cois240 lesson01
PPT
computer programming language c presenations 2
PDF
The effective daum coursework focused on open source software in Jeju Nationa...
PPT
Savitch ch 01
Swift Tutorial Free For You To Use Brooo
Academic Day 2211.pptx
Extracurricular Swift
Crash Course in Objective-C
ICS3MeBook
Austin Python Learners Meetup - Everything you need to know about programming...
Java basics
Download Complete The Rust Programming Language 2nd Edition Steve Klabnik PDF...
Scientific Programming Clanguage Algorithms And Models In Science Luciano M B...
01 computer programming
Feedback on Part 1 of the Software Engineering Large Practical
C++ progrmming language
(Ebook) The Rust Programming Language, Second Edition by Steve Klabnik, Carol...
Class 27: Pythonic Objects
Cbj 2 1_2005_callief_ida
Introduction to Computer Science Using Python and Pygame
Cois240 lesson01
computer programming language c presenations 2
The effective daum coursework focused on open source software in Jeju Nationa...
Savitch ch 01
Ad

More from Stephen Gilmore (17)

PDF
More Stochastic Simulation Examples
PDF
Testing Android apps with Robotium
PDF
Common Java problems when developing with Android
PDF
Working with databases in Android
PDF
SELP: Debugging, AVDs and Manifests
PDF
The Stochastic Simulation Algorithm
PDF
Beginning Android Development
PDF
Computer Science Large Practical coursework
PDF
Software Engineering Large Practical coursework
PDF
Introduction to the CSLP and the SELP
PDF
Fixing errors in Android Java applications
PDF
Feedback on Part 1 of the Individual Practical
PDF
Creating and working with databases in Android
PDF
Continuing Android development
PDF
Project management for the individual practical
PDF
Beginning Android development
PDF
CS/SE Individual practical - DDMS and AVD
More Stochastic Simulation Examples
Testing Android apps with Robotium
Common Java problems when developing with Android
Working with databases in Android
SELP: Debugging, AVDs and Manifests
The Stochastic Simulation Algorithm
Beginning Android Development
Computer Science Large Practical coursework
Software Engineering Large Practical coursework
Introduction to the CSLP and the SELP
Fixing errors in Android Java applications
Feedback on Part 1 of the Individual Practical
Creating and working with databases in Android
Continuing Android development
Project management for the individual practical
Beginning Android development
CS/SE Individual practical - DDMS and AVD
Ad

Recently uploaded (20)

PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Computing-Curriculum for Schools in Ghana
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
01-Introduction-to-Information-Management.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Classroom Observation Tools for Teachers
PPTX
Lesson notes of climatology university.
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Cell Structure & Organelles in detailed.
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
Pharma ospi slides which help in ospi learning
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
VCE English Exam - Section C Student Revision Booklet
2.FourierTransform-ShortQuestionswithAnswers.pdf
202450812 BayCHI UCSC-SV 20250812 v17.pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
Supply Chain Operations Speaking Notes -ICLT Program
human mycosis Human fungal infections are called human mycosis..pptx
O5-L3 Freight Transport Ops (International) V1.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Computing-Curriculum for Schools in Ghana
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
01-Introduction-to-Information-Management.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Classroom Observation Tools for Teachers
Lesson notes of climatology university.
Final Presentation General Medicine 03-08-2024.pptx
Complications of Minimal Access Surgery at WLH
Cell Structure & Organelles in detailed.
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Pharma ospi slides which help in ospi learning

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