SlideShare a Scribd company logo
iPhone Development Intro




                      www.braceta.com
Luis Azevedo    www.twitter.com/braceta
Overview

• Tools/SDK
• Setting up
• Objective-C
• Demo?
Setting up...
Setting up...
• Get a Mac
Setting up...
• Get a Mac
• Get the SDK
Setting up...
• Get a Mac
• Get the SDK
• Install
Setting up...
• Get a Mac
• Get the SDK
• Install
• Get an Apple Developer Connection
  account
Setting up...
• Get a Mac
• Get the SDK
• Install
• Get an Apple Developer Connection
  account
Setting up...
• Get a Mac
• Get the SDK
• Install
• Get an Apple Developer Connection €€€
  account
Setting up...
• Get a Mac
• Get the SDK
• Install
• Get an Apple Developer Connection €€€
  account
• Code
Setting up...
• Get a Mac
• Get the SDK
• Install
• Get an Apple Developer Connection €€€
  account
• Code
• Profit?
Tools/SDK

• Xcode
• iPhone/iPod or iPad
• Interface Builder
• iPhone Simulator
• Instruments
Xcode
Simulator
Interface Builder
Instruments
Languages

•C
• C++
• Objective-C
• Objective-C++
Objective-C
    History
C   Smalltalk
C   Smalltalk




     Objective-C
C   Smalltalk




     Objective-C

                C++
C   Smalltalk




     Objective-C

                C++

           Java    C#
C   Smalltalk




     Objective-C

                C++

           Java    C#
C   Smalltalk




     Objective-C

                C++

           Java    C#
Objective-C
   Description
Objective-C
Objective-C
• OOP
Objective-C
• OOP
• Dynamic
Objective-C
• OOP
• Dynamic
• based on message passing
Objective-C
• OOP
• Dynamic
• based on message passing
• single inherance
Objective-C
• OOP
• Dynamic
• based on message passing
• single inherance
• Protocols and Categories
Objective-C
• OOP
• Dynamic
• based on message passing
• single inherance
• Protocols and Categories
• full of [] and @s
Files


• .h - Header files
• .m - Class implementation files
Objective-C
    Sintax
Syntax Examples
Syntax Examples
[object method];
Syntax Examples
[object method];
int value = [object method];
Syntax Examples
[object method];
int value = [object method];
[object method:argument];
Syntax Examples
[object method];
int value = [object method];
[object method:argument];
[[object method] method2];
Syntax Examples
[object method];
int value = [object method];
[object method:argument];
[[object method] method2];
[object method:argument option:anotherArg];
.m file


- (id) thisIsAMethod:(int)param1
                 options:(float)param2
.m file


- (id) thisIsAMethod:(int)param1
                 options:(float)param2

 {
     for (int n = 0; n < 10; ++n)
     {
         NSLog(@”N=%d”, n);
         [object callMethod:1 thing:2];
     }
 }
.m file
@implementation MyClass
- (id) thisIsAMethod:(int)param1
                 options:(float)param2

 {
       for (int n = 0; n < 10; ++n)
       {
           NSLog(@”N=%d”, n);
           [object callMethod:1 thing:2];
       }
 }
@end
.m file
@implementation MyClass
- (id) thisIsAMethod:(int)param1
        @class     options:(float)param2
        @interface
  {
        @end
      for (int n = 0; n < 10; ++n)
      { @property
           NSLog(@”N=%d”, n);
        @private
           [object callMethod:1 thing:2];
      } @protected
  }
@end
.m file
@implementation MyClass
- (id) thisIsAMethod:(int)param1
                 options:(float)param2

 {
       for (int n = 0; n < 10; ++n)
       {
           NSLog(@”N=%d”, n);
           [object callMethod:1 thing:2];
       }
 }
@end
.m file
@implementation MyClass
- (id) thisIsAMethod:(int)param1
                 options:(float)param2

 {
       for (int n = 0; n < 10; ++n)
       {
           NSLog(@”N=%d”, n);
           [object callMethod:1 thing:2];
       }
 }
@end
.m file
@implementation MyClass
- (id) thisIsAMethod:(int)param1
                 options:(float)param2

 {
       for (int n = 0; n < 10; ++n)
       {
           NSLog(@”N=%d”, n);
           [object callMethod:1 thing:2];
       }
 }
@end
.m file
@implementation MyClass
- (id) thisIsAMethod:(int)param1
                 options:(float)param2

 {
       for (int n = 0; n < 10; ++n)
       {
        NSString
             NSLog(@”N=%d”, n);
             [object callMethod:1 thing:2];
       }
 }
@end
.h file
#import <Foundation/Foundation.h>

@interface MyClass : NSObject
{
      NSDictionary *member;
      bool otherMember;
}
- (void) init;
- (id) initWithItems:(NSArray*)array
               enabled:(bool)enabled;

+ (id) myClassWithItems:(NSArray*)array;

@end
.h file
#import <Foundation/Foundation.h>

@interface MyClass : NSObject
{
      NSDictionary *member;
      bool otherMember;
}
- (void) init;
- (id) initWithItems:(NSArray*)array
               enabled:(bool)enabled;

+ (id) myClassWithItems:(NSArray*)array;

@end
.h file
#import <Foundation/Foundation.h>

@interface MyClass : NSObject
{
      NSDictionary *member;
      bool otherMember;
}
- (void) init;
- (id) initWithItems:(NSArray*)array
               enabled:(bool)enabled;

+ (id) myClassWithItems:(NSArray*)array;

@end
.h file
#import <Foundation/Foundation.h>

@interface MyClass : NSObject
{
      NSDictionary *member;
      bool otherMember;
}
- (void) init;
- (id) initWithItems:(NSArray*)array
               enabled:(bool)enabled;

+ (id) myClassWithItems:(NSArray*)array;

@end
.h file
#import <Foundation/Foundation.h>

@interface MyClass : NSObject
{
      NSDictionary *member;
      bool otherMember;
}
- (void) init;
- (id) initWithItems:(NSArray*)array
               enabled:(bool)enabled;

+ (id) myClassWithItems:(NSArray*)array;

@end
Syntax Examples

// Create MyClass instance
MyClass *myClass = [[MyClass alloc] init];
Properties
@interface MyClass
{
    int harold;
}

@property (nonatomic,retain) int age;

@end

// In MyClass.m...

@interface MyClass
@synthesize age;
@end
Properties


[myClass setAge:20];
myClass.age = 20; // is calling setAge
Categories

@interface NSObject (Foo)
- (void) extraFooMethod;
@end
Categories
@interface NSObject (Foo)
- (void) extraFooMethod;
@end


NSArray *array = [NSArray array];
[array extraFooMethod];
iOS Development
iOS Frameworks
iOS Frameworks

     Cocoa Touch
iOS Frameworks

                   UIKit, MapKit, Printing,
     Cocoa Touch   Gesture Recognizers
iOS Frameworks

                   UIKit, MapKit, Printing,
     Cocoa Touch   Gesture Recognizers



       Media
iOS Frameworks

                   UIKit, MapKit, Printing,
     Cocoa Touch   Gesture Recognizers



                   Core Audio, Open GL ES,
       Media       Quartz, Core Animation
iOS Frameworks

                    UIKit, MapKit, Printing,
     Cocoa Touch    Gesture Recognizers



                    Core Audio, Open GL ES,
       Media        Quartz, Core Animation




    Core Services
iOS Frameworks

                    UIKit, MapKit, Printing,
     Cocoa Touch    Gesture Recognizers



                    Core Audio, Open GL ES,
       Media        Quartz, Core Animation


                    Core Data, Core
    Core Services   Foundation, Address Book
                    Framework
iOS Frameworks

                    UIKit, MapKit, Printing,
     Cocoa Touch    Gesture Recognizers



                    Core Audio, Open GL ES,
       Media        Quartz, Core Animation


                    Core Data, Core
    Core Services   Foundation, Address Book
                    Framework



      Core OS
iOS Frameworks

                    UIKit, MapKit, Printing,
     Cocoa Touch    Gesture Recognizers



                    Core Audio, Open GL ES,
       Media        Quartz, Core Animation


                    Core Data, Core
    Core Services   Foundation, Address Book
                    Framework



      Core OS       Posix Threads, SQLite
iOS Frameworks

                              UIKit, MapKit, Printing,
Objective C   Cocoa Touch     Gesture Recognizers



                              Core Audio, Open GL ES,
                 Media        Quartz, Core Animation


                              Core Data, Core
              Core Services   Foundation, Address Book
                              Framework




   C            Core OS       Posix Threads, SQLite
UIKit
UIKit
MVC Pattern
MVC Pattern




Model
MVC Pattern
            View




Model
MVC Pattern
            View




Model              Controller
MVC Pattern
            View




Model              Controller
MVC Pattern
            View




Model              Controller
Views
Views
• UIView class
Views
• UIView class
• View Object is a rectangle on the screen
Views
• UIView class
• View Object is a rectangle on the screen
• Handles touch events
Views
• UIView class
• View Object is a rectangle on the screen
• Handles touch events
• Can be container for other views
Views
• UIView class
• View Object is a rectangle on the screen
• Handles touch events
• Can be container for other views
• Can be created programatically or with
  Interface Builder
Views
• UIView class
• View Object is a rectangle on the screen
• Handles touch events
• Can be container for other views
• Can be created programatically or with
  Interface Builder
• Can be animated using Core Animations
Views
ViewControllers
ViewControllers
• iOS Controllers are ViewControllers
ViewControllers
• iOS Controllers are ViewControllers
• Descendant of UIViewController
ViewControllers
• iOS Controllers are ViewControllers
• Descendant of UIViewController
• Provides all the logic to bridge data from
  the model and the view
ViewControllers
• iOS Controllers are ViewControllers
• Descendant of UIViewController
• Provides all the logic to bridge data from
  the model and the view
• Loads Views
ViewControllers
• iOS Controllers are ViewControllers
• Descendant of UIViewController
• Provides all the logic to bridge data from
  the model and the view
• Loads Views
• Implements the code to handle actions
  triggered by touch events on views
ViewController
.XIB Files
.XIB Files

• Interface Builder XML GUI spec files
.XIB Files

• Interface Builder XML GUI spec files
• Connects from IB to the Code
.XIB Files

• Interface Builder XML GUI spec files
• Connects from IB to the Code
• Only on iOS. At build time are converted
  to NIB files
Demo
Resources
Beggining iPhone 3 Development
   Dave Mark | Jeff LaMarche
 http://iphonedevelopment.blogspot.com/
Resources
Facebook Three20 Obj-C
      Framework

https://github.com/facebook/three20
Q&A

More Related Content

KEY
Objective-C Crash Course for Web Developers
PDF
Iphone course 1
PDF
Building DSLs with Xtext - Eclipse Modeling Day 2009
PDF
The Xtext Grammar Language
PDF
Using Xcore with Xtext
KEY
Parte II Objective C
KEY
360iDev iOS AntiPatterns
PDF
Zend Framework 1 + Doctrine 2
Objective-C Crash Course for Web Developers
Iphone course 1
Building DSLs with Xtext - Eclipse Modeling Day 2009
The Xtext Grammar Language
Using Xcore with Xtext
Parte II Objective C
360iDev iOS AntiPatterns
Zend Framework 1 + Doctrine 2

What's hot (19)

PPTX
Jquery
PDF
Es.next
PPTX
J query1
PDF
Jazoon 2010 - Building DSLs with Eclipse
PPT
J query
PPTX
Scala on Android
KEY
みゆっき☆Think#7 「本気で学ぶJavascript」
PDF
greenDAO
KEY
Xtext Eclipse Con
PDF
C# Starter L02-Classes and Objects
PDF
Green dao
PPTX
Awesomeness of JavaScript…almost
PPT
Reversing JavaScript
PPTX
All about scala
PPTX
GreenDao Introduction
PPTX
COLLADA & WebGL
PPTX
From C++ to Objective-C
PPTX
PPT
CodeMash - Building Rich Apps with Groovy SwingBuilder
Jquery
Es.next
J query1
Jazoon 2010 - Building DSLs with Eclipse
J query
Scala on Android
みゆっき☆Think#7 「本気で学ぶJavascript」
greenDAO
Xtext Eclipse Con
C# Starter L02-Classes and Objects
Green dao
Awesomeness of JavaScript…almost
Reversing JavaScript
All about scala
GreenDao Introduction
COLLADA & WebGL
From C++ to Objective-C
CodeMash - Building Rich Apps with Groovy SwingBuilder
Ad

Viewers also liked (17)

PPTX
Babysho
KEY
Socialmedialiverpool 120209011224-phpapp02
PPTX
Introduzione Alla Web Analytics
PDF
Ems 131 chapter_1
PPS
Cactus Blooms - Motivation for Life
PDF
iGaming360 Brochure
PPTX
PPT
Polynésie française
PPTX
Introduzione Alla Web Analytics
PPT
Wikipedia Campaign Management Assignment Session No 4 By Kashif Waqar Khan
PPSX
Bruce B. Barker Portfolio
PPT
Current Vacancies
PDF
Orange Telecom - Kashif Waqar Khan - IE MDMK2011
PDF
Revista biotec 11
PDF
Gigse 2010 Brochure
PDF
StudioLEiN
PPSX
Event Marketing 101
Babysho
Socialmedialiverpool 120209011224-phpapp02
Introduzione Alla Web Analytics
Ems 131 chapter_1
Cactus Blooms - Motivation for Life
iGaming360 Brochure
Polynésie française
Introduzione Alla Web Analytics
Wikipedia Campaign Management Assignment Session No 4 By Kashif Waqar Khan
Bruce B. Barker Portfolio
Current Vacancies
Orange Telecom - Kashif Waqar Khan - IE MDMK2011
Revista biotec 11
Gigse 2010 Brochure
StudioLEiN
Event Marketing 101
Ad

Similar to iPhone Development Intro (20)

PPT
iPhone development from a Java perspective (Jazoon '09)
PPTX
Getting started with titanium
PPTX
Mobile Developers Talks: Delve Mobile
PPTX
Getting started with Appcelerator Titanium
PDF
iOS overview
PDF
Jeff English: Demystifying Module Development - How to Extend Titanium
PDF
Irving iOS Jumpstart Meetup - Objective-C Session 2
PPT
Programming iOS in C#
PDF
FI MUNI 2012 - iOS Basics
PDF
MFF UK - Introduction to iOS
PDF
Painless Persistence in a Disconnected World
PPTX
.NET Foundation, Future of .NET and C#
PPT
.Net 3.5
PDF
Node azure
PDF
iOS 101 - Xcode, Objective-C, iOS APIs
PDF
The Art Of Readable Code
PDF
Native Phone Development 101
PDF
soft-shake.ch - Hands on Node.js
PPTX
iPhone Workshop Mobile Monday Ahmedabad
PPTX
Android development with Scala and SBT
iPhone development from a Java perspective (Jazoon '09)
Getting started with titanium
Mobile Developers Talks: Delve Mobile
Getting started with Appcelerator Titanium
iOS overview
Jeff English: Demystifying Module Development - How to Extend Titanium
Irving iOS Jumpstart Meetup - Objective-C Session 2
Programming iOS in C#
FI MUNI 2012 - iOS Basics
MFF UK - Introduction to iOS
Painless Persistence in a Disconnected World
.NET Foundation, Future of .NET and C#
.Net 3.5
Node azure
iOS 101 - Xcode, Objective-C, iOS APIs
The Art Of Readable Code
Native Phone Development 101
soft-shake.ch - Hands on Node.js
iPhone Workshop Mobile Monday Ahmedabad
Android development with Scala and SBT

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation theory and applications.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
KodekX | Application Modernization Development
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
A Presentation on Artificial Intelligence
Mobile App Security Testing_ A Comprehensive Guide.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Reach Out and Touch Someone: Haptics and Empathic Computing
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation theory and applications.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
KodekX | Application Modernization Development
Understanding_Digital_Forensics_Presentation.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
CIFDAQ's Market Insight: SEC Turns Pro Crypto
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Big Data Technologies - Introduction.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
A Presentation on Artificial Intelligence

iPhone Development Intro