SlideShare a Scribd company logo
Xcode
Basics and Beyond



    cocoaheads.be
Foreword
• The goals of this talk are
  • to give some starting points
  • to present somewhat more specific details of interest


• It is not an exhaustive presentation of Xcode

• For more information on a specific subject, please
 refer to any of the following:
  • Documentation
  • Mailing Lists / Forums
  • Google
Background
• What is Xcode?
  • Appleʼs IDE for Mac and iPhone/iPad development
• History
  • Roots in NeXTStep, late 80ʼs, early 90ʼs (PB)
  • Introduced in 2003, as a replacement for good old Project
    Builder
  • Evolves over time, now at version 3.2 (April 2010)
• How to get it?
  • Comes with Snow Leopard DVD
  • Available for free from ADC (online registration)
Main Features
• Build System (~Makefile)
  • dependencies, command-line, distributed build across
    network, configuration of app targets, compiler integration...
• Source Code Editor
  • Code completion and coloring, symbol indexing,
    navigation, ...
• Debugger
  • Tight gdb integration, step by step, runtime variable
    inspection, remote debug...
• Documentation
  • Contextual help, guides, reference.
• Organizer
  • Projects repository + Device browser
Basics
Introduction
• What is an App? (developer point of view)
                                MyApp.app/
                                 Contents/
                                  MacOS/
                                     MyApp
                        B         Resources/
                        U            MyApp.icns
                        I            image1.tiff
                        L            en.lproj/
                        D                MainWindow.nib
                                     fr.lproj/
                                         MainWindow.nib
Creating an App: Fast Start
• Keep head out of water, dive only when needed.
• Create a Project from a Template
  • Many pre-configured project. Use them as starting point.




• Build and Run. There you go.
Xcode, Basics and Beyond
Xcode Project
• Anatomy of an Xcode project


      Target A: Framework            Target B: Application

              Sources                        Sources
             .m, .h, .py                    .m, .h, .py

              Resources                      Resources
      .tiff, .aiff, .png, .strings   .tiff, .aiff, .png, .strings
                    etc.                           etc.
Targets
• You need one to build an app, framework, library
• Basically, a target keeps track of
  • all needed files (sources, resources),
  • external library dependencies,
  • settings to build
• A target is composed of “Build Phases”
  • Sequence of operation to create a product
     • Compile sources + Link
     • Copy resources in app bundle
     • etc.
Build Settings
• Configuration of target, compiler, linker settings...
• Inheritance (order is important)
  • Command Line
  • Target
  • Project
• 2 Common Configurations: Debug & Release
  • Debug
     • Removes code optimization (runs slower)
     • Debugging symbols
     • Builds only one architecture
  • Release
     • Optimizes code (runs faster)
     • Removes debugging symbols
     • Builds as universal binary
  • Define new ones for iPhone (Ad Hoc, App Store Distribution)
Xcode, Basics and Beyond
Demo #1
Beyond Basics
Focus on Efficiency
• Make all you can to be productive.

• Efficient Navigation (Key / Mouse)
• Code Reuse through Cross Project Depʼs
• Editor Scripts
• Config Files
• Smart Debugging
• Task Automation
Efficient Navigation
• Keyboard Navigation
  •   Cmd-Double-Click, Opt-Double-Click: go to def. / go to doc.
  •   Cmd-0: Project window
  •   Cmd-Shift-E: Maximize Editor
  •   Cmd-B: Build, Cmd-Shift-B: Show build results
  •   Cmd-R: Run, Cmd-Shift-R: Show run window
  •   Cmd-Y: Debug, Cmd-Shift-Y: Show debugger
  •   Cmd-Ctrl-O: Show Organizer Window
  •   Opt-Cmd-Up: switch to header/source
  •   Cmd-=: Next Warning/Error
  •   Cmd-`: Next Window
Efficient Navigation
• You can customize Xcode shortcuts in the Prefs

• Custom Shortcuts
  • Cmd-T: Open Quickly (same as Text Mate)
     • then type file name or function name !
  • ESC: complete, Opt-ESC: code sense complete
     • then F1 to move cursor to arg
  • Opt-Cmd-Left/Right: previous/next focus point (+Ctrl for file)
  • Opt-Cmd-Down: Pop Symbol PopUp (alphabetically sorted !)
Demo #2
Code Re-use
• Your project may depend on another. Example:
  • Framework: CompanyBase.framework
     • Has common categories to Cocoa types
     • Handles license and About Panels
     • ...
  • App1, App2 depend on CompanyBase.framework


• To get it to build automatically then:
  • Import CompanyBase.xcodeproj into App1.xcodeproj
  • Setup target dependency + link + copy build phase

• Configuration names (Debug, Release) are passed along
Demo #3
Smart Debugging
• Interactive Debugger
  • Step by step, variable inspection (hover)
• gdb command invocation
  • po, print, call
  • Useful: apropos word, help command
• Fix and Continue (Mac only!)
  • Change code while program is running
  • No need to restart
• Customizing variable display: Data Formatters
  • Ex: x={$VAR.translation[0]}:v, y={$VAR.translation[1]}:v
  • This is global
  • To revert to original, just delete your stuff
Demo #4
Task Automation
• The main idea is:
  ★ “Fix a bug, then deploy your app with 3 mouse clicks”


• Wouldnʼt it be great if you could automatically
  •   remove headers of embedded framework
  •   prepare signed zip (Sparkle)
  •   have embedded PSDs converted to PNG
  •   encrypt embedded Core Image kernels
  •   upload your app to the server and deploy it


• Well, you can.
Demo #5 (last one)
Happy (X)coding !


web: 	

 	

 www.creaceed.com
email: 	

	

 raphael@creaceed.com
                                     cocoaheads.be
twitter: 	

 @rsebbe

More Related Content

PDF
Introduction to xcode
PPT
Ios development
PPT
ios basics
PDF
Никита Корчагин - Introduction to Apple iOS Development.
PDF
Architecting iOS Project
PPTX
Dev days 1 Introduction to Xamarin Taswar Bhatti
PPTX
Ярослав Воронцов — Пара слов о mobile security.
PDF
iOS Development Survival Guide for the .NET Guy
Introduction to xcode
Ios development
ios basics
Никита Корчагин - Introduction to Apple iOS Development.
Architecting iOS Project
Dev days 1 Introduction to Xamarin Taswar Bhatti
Ярослав Воронцов — Пара слов о mobile security.
iOS Development Survival Guide for the .NET Guy

What's hot (20)

PPTX
An overview of mobile html + java script frameworks
PPTX
iOS Coding Best Practices
PDF
Pentesting iOS Apps - Runtime Analysis and Manipulation
PDF
ios-mobile-app-development-intro
PPTX
How to become iPhone developer
PDF
Lesson 02 - React Native Development Environment Setup
ODP
FirefoxOS and its use of Linux (a deep dive into Gonk architecture)
PDF
iOS Application Security
PPTX
App forum2015 London - Building RhoMobile Applications with Ionic
PPTX
PDE builds or Maven
PPTX
Xamarin forms introduction by Taswar Bhatti and Ahmed Assad
KEY
C# on the iPhone with MonoTouch Glasgow
PPTX
Building an Ionic hybrid mobile app with TypeScript
PPTX
Firefox os
PPTX
Firefox os ppt
PPTX
IONIC - Hybrid Mobile App Development
PDF
Android Workshop_1
PPTX
Cross-Platform Development
PPT
Android - Anroid Pproject
An overview of mobile html + java script frameworks
iOS Coding Best Practices
Pentesting iOS Apps - Runtime Analysis and Manipulation
ios-mobile-app-development-intro
How to become iPhone developer
Lesson 02 - React Native Development Environment Setup
FirefoxOS and its use of Linux (a deep dive into Gonk architecture)
iOS Application Security
App forum2015 London - Building RhoMobile Applications with Ionic
PDE builds or Maven
Xamarin forms introduction by Taswar Bhatti and Ahmed Assad
C# on the iPhone with MonoTouch Glasgow
Building an Ionic hybrid mobile app with TypeScript
Firefox os
Firefox os ppt
IONIC - Hybrid Mobile App Development
Android Workshop_1
Cross-Platform Development
Android - Anroid Pproject
Ad

Similar to Xcode, Basics and Beyond (20)

KEY
iPhone Development Tools
PPTX
Build software like a bag of marbles, not a castle of LEGO®
KEY
Mobeers waterloo-2011
PDF
Building Effective and Rapid Applications with IBM MobileFirst Platform
PDF
ChrisSchilling_SideProjects
KEY
Zend Code in ZF 2.0
PPTX
NCDevCon 2017 - Cross Platform Mobile Apps
PDF
Image Processing and Computer Vision in iPhone and iPad
PDF
Doug McCune - Using Open Source Flex and ActionScript Projects
PDF
The Architect Way - JSCamp.asia 2012
PPTX
iOS Application Exploitation
PDF
Next Step, Android Studio!
PPTX
React nativebeginner1
PDF
Xamarin v.Now
PDF
Mobile Fest 2018. Алексей Лизенко. Make your project great again
PPTX
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
PPT
Joomla as a mobile App backend - ideas, examples and experiences
PPTX
Neev Open Source Contributions
PPTX
Rise of the hybrids
PDF
Citibank
iPhone Development Tools
Build software like a bag of marbles, not a castle of LEGO®
Mobeers waterloo-2011
Building Effective and Rapid Applications with IBM MobileFirst Platform
ChrisSchilling_SideProjects
Zend Code in ZF 2.0
NCDevCon 2017 - Cross Platform Mobile Apps
Image Processing and Computer Vision in iPhone and iPad
Doug McCune - Using Open Source Flex and ActionScript Projects
The Architect Way - JSCamp.asia 2012
iOS Application Exploitation
Next Step, Android Studio!
React nativebeginner1
Xamarin v.Now
Mobile Fest 2018. Алексей Лизенко. Make your project great again
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
Joomla as a mobile App backend - ideas, examples and experiences
Neev Open Source Contributions
Rise of the hybrids
Citibank
Ad

More from rsebbe (7)

PDF
Orthogonality: A Strategy for Reusable Code
PDF
Advanced Imaging on iOS
PDF
iOS 7 URL Session & Motion FX APIs
PDF
CeedMath & CeedGL, Let's talk 3D...
PDF
Blocks & GCD
PDF
Designing an Objective-C Framework about 3D
PDF
Computer-aided Diagnosis of Pulmonary Embolism in Opacified CT Images
Orthogonality: A Strategy for Reusable Code
Advanced Imaging on iOS
iOS 7 URL Session & Motion FX APIs
CeedMath & CeedGL, Let's talk 3D...
Blocks & GCD
Designing an Objective-C Framework about 3D
Computer-aided Diagnosis of Pulmonary Embolism in Opacified CT Images

Recently uploaded (20)

PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
KodekX | Application Modernization Development
PPTX
Big Data Technologies - Introduction.pptx
PDF
Modernizing your data center with Dell and AMD
PPT
Teaching material agriculture food technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Spectral efficient network and resource selection model in 5G networks
Agricultural_Statistics_at_a_Glance_2022_0.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Approach and Philosophy of On baking technology
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
MYSQL Presentation for SQL database connectivity
Building Integrated photovoltaic BIPV_UPV.pdf
Empathic Computing: Creating Shared Understanding
“AI and Expert System Decision Support & Business Intelligence Systems”
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Encapsulation_ Review paper, used for researhc scholars
KodekX | Application Modernization Development
Big Data Technologies - Introduction.pptx
Modernizing your data center with Dell and AMD
Teaching material agriculture food technology
Chapter 3 Spatial Domain Image Processing.pdf
NewMind AI Monthly Chronicles - July 2025

Xcode, Basics and Beyond

  • 1. Xcode Basics and Beyond cocoaheads.be
  • 2. Foreword • The goals of this talk are • to give some starting points • to present somewhat more specific details of interest • It is not an exhaustive presentation of Xcode • For more information on a specific subject, please refer to any of the following: • Documentation • Mailing Lists / Forums • Google
  • 3. Background • What is Xcode? • Appleʼs IDE for Mac and iPhone/iPad development • History • Roots in NeXTStep, late 80ʼs, early 90ʼs (PB) • Introduced in 2003, as a replacement for good old Project Builder • Evolves over time, now at version 3.2 (April 2010) • How to get it? • Comes with Snow Leopard DVD • Available for free from ADC (online registration)
  • 4. Main Features • Build System (~Makefile) • dependencies, command-line, distributed build across network, configuration of app targets, compiler integration... • Source Code Editor • Code completion and coloring, symbol indexing, navigation, ... • Debugger • Tight gdb integration, step by step, runtime variable inspection, remote debug... • Documentation • Contextual help, guides, reference. • Organizer • Projects repository + Device browser
  • 6. Introduction • What is an App? (developer point of view) MyApp.app/ Contents/ MacOS/ MyApp B Resources/ U MyApp.icns I image1.tiff L en.lproj/ D MainWindow.nib fr.lproj/ MainWindow.nib
  • 7. Creating an App: Fast Start • Keep head out of water, dive only when needed. • Create a Project from a Template • Many pre-configured project. Use them as starting point. • Build and Run. There you go.
  • 9. Xcode Project • Anatomy of an Xcode project Target A: Framework Target B: Application Sources Sources .m, .h, .py .m, .h, .py Resources Resources .tiff, .aiff, .png, .strings .tiff, .aiff, .png, .strings etc. etc.
  • 10. Targets • You need one to build an app, framework, library • Basically, a target keeps track of • all needed files (sources, resources), • external library dependencies, • settings to build • A target is composed of “Build Phases” • Sequence of operation to create a product • Compile sources + Link • Copy resources in app bundle • etc.
  • 11. Build Settings • Configuration of target, compiler, linker settings... • Inheritance (order is important) • Command Line • Target • Project • 2 Common Configurations: Debug & Release • Debug • Removes code optimization (runs slower) • Debugging symbols • Builds only one architecture • Release • Optimizes code (runs faster) • Removes debugging symbols • Builds as universal binary • Define new ones for iPhone (Ad Hoc, App Store Distribution)
  • 15. Focus on Efficiency • Make all you can to be productive. • Efficient Navigation (Key / Mouse) • Code Reuse through Cross Project Depʼs • Editor Scripts • Config Files • Smart Debugging • Task Automation
  • 16. Efficient Navigation • Keyboard Navigation • Cmd-Double-Click, Opt-Double-Click: go to def. / go to doc. • Cmd-0: Project window • Cmd-Shift-E: Maximize Editor • Cmd-B: Build, Cmd-Shift-B: Show build results • Cmd-R: Run, Cmd-Shift-R: Show run window • Cmd-Y: Debug, Cmd-Shift-Y: Show debugger • Cmd-Ctrl-O: Show Organizer Window • Opt-Cmd-Up: switch to header/source • Cmd-=: Next Warning/Error • Cmd-`: Next Window
  • 17. Efficient Navigation • You can customize Xcode shortcuts in the Prefs • Custom Shortcuts • Cmd-T: Open Quickly (same as Text Mate) • then type file name or function name ! • ESC: complete, Opt-ESC: code sense complete • then F1 to move cursor to arg • Opt-Cmd-Left/Right: previous/next focus point (+Ctrl for file) • Opt-Cmd-Down: Pop Symbol PopUp (alphabetically sorted !)
  • 19. Code Re-use • Your project may depend on another. Example: • Framework: CompanyBase.framework • Has common categories to Cocoa types • Handles license and About Panels • ... • App1, App2 depend on CompanyBase.framework • To get it to build automatically then: • Import CompanyBase.xcodeproj into App1.xcodeproj • Setup target dependency + link + copy build phase • Configuration names (Debug, Release) are passed along
  • 21. Smart Debugging • Interactive Debugger • Step by step, variable inspection (hover) • gdb command invocation • po, print, call • Useful: apropos word, help command • Fix and Continue (Mac only!) • Change code while program is running • No need to restart • Customizing variable display: Data Formatters • Ex: x={$VAR.translation[0]}:v, y={$VAR.translation[1]}:v • This is global • To revert to original, just delete your stuff
  • 23. Task Automation • The main idea is: ★ “Fix a bug, then deploy your app with 3 mouse clicks” • Wouldnʼt it be great if you could automatically • remove headers of embedded framework • prepare signed zip (Sparkle) • have embedded PSDs converted to PNG • encrypt embedded Core Image kernels • upload your app to the server and deploy it • Well, you can.
  • 25. Happy (X)coding ! web: www.creaceed.com email: raphael@creaceed.com cocoaheads.be twitter: @rsebbe