SlideShare a Scribd company logo
iPhone Edinburgh
       BCS development a brief introduction                                        pete goodliffe




                                Hello,
                                world!
                                                  iPhone
                                                    iOS
                                                   Development
                                                   a brief introduction
                                                           rkably , very
                                                      rema
                                              really,


                                                                           Pete Goodliffe
                                                                           pete@goodliffe.net
Thursday, 10 March 2011
iPhone development a brief introduction                                 pete goodliffe




                                          Pete Goodliffe
                                            A programmer, a columnist,
                                            an author, a teacher. Someone
                                            who cares about code.
                                                                   www.goodliffe.net
                                                                goodliffe.blogspot.com
                                                                        @petegoodliffe




Thursday, 10 March 2011
iPhone development a brief introduction                                 pete goodliffe




                                          Pete Goodliffe
                                            A programmer, a columnist,
                                            an author, a teacher. Someone
                                            who cares about code.
                                                                   www.goodliffe.net
                                                                goodliffe.blogspot.com
                                                                        @petegoodliffe




Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe




Thursday, 10 March 2011
iPhone development a brief introduction                                                              pete goodliffe




            talk synopsis
                          An introduction to iPhone/iOS development
                          An introduction to iPhone development for beginners or those who are casually
                          interested and want a leg up the learning curve.

                          This talk is an overview of how to get started as an iPhone developer, and an
                          introduction to the core technologies, including:

                          ‣   Common iPhone/Mac OS design patterns, idioms, and practices
                          ‣   Becoming a native: how to "think in iPhone"
                          ‣   Overview of the libraries and facilities that exist
                          ‣   Limitations of the development environment




Thursday, 10 March 2011
iPhone development a brief introduction                pete goodliffe




                              90 minutes? is that all?!!!

Thursday, 10 March 2011
iPhone development a brief introduction                                                       pete goodliffe




   in 90 minutes...                                     Demo           Intro
               ‣ Intro
               ‣ The tools                       Tips
               ‣ The language                                                      Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                           Language

               ‣ Tips and tricks                        Deploying
               ‣ The demo                                                          UI
                                                                    Technologies




                             m… pie
                          Mm
Thursday, 10 March 2011
iPhone development a brief introduction                                                       pete goodliffe




   in 90 minutes...                                     Demo
                                                                       Intro



               ‣ Intro


                   Introduction
               ‣ The tools                       Tips
               ‣ The language                                                      Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                           Language

               ‣ Tips and tricks                        Deploying
               ‣ The demo                                                          UI
                                                                    Technologies




Thursday, 10 March 2011
iPhone development a brief introduction     pete goodliffe




                                  who are you?




Thursday, 10 March 2011
iPhone development a brief introduction     pete goodliffe




                                why develop
                               for the iPhone?




Thursday, 10 March 2011
iPhone development a brief introduction    pete goodliffe




                             the alternatives




Thursday, 10 March 2011
iPhone development a brief introduction                                                       pete goodliffe




   in 90 minutes...                                     Demo
                                                                       Intro



               ‣ Intro
               ‣ The tools                       Tips
               ‣ The language                                                      Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                           Language

               ‣ Tips and tricks                        Deploying
               ‣ The demo                                                          UI
                                                                    Technologies




Thursday, 10 March 2011
iPhone development a brief introduction                                                       pete goodliffe




   in 90 minutes...                                     Demo           Intro
               ‣ Intro
               ‣ The tools                       Tips
               ‣ The language                                                      Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                           Language

               ‣ Tips and tricks                        Deploying
               ‣ The demo                                                          UI
                                                                    Technologies




Thursday, 10 March 2011
iPhone development a brief introduction                                                       pete goodliffe




   in 90 minutes...                                     Demo           Intro
               ‣ Intro


                            The tools
               ‣ The tools                       Tips                                    Tools
               ‣ The language
               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                           Language

               ‣ Tips and tricks                        Deploying
               ‣ The demo                                                          UI
                                                                    Technologies




Thursday, 10 March 2011
iPhone development a brief introduction                pete goodliffe




                                      ❖        The cast ❖
                                   Xcode
                          iPhone/iPod Touch/iPad
                              Interface builder
                              iPhone simulator
                             Instruments/Shark
                           iOS Provisioning Portal
                                 Other tools


Thursday, 10 March 2011
iPhone development a brief introduction           pete goodliffe




                                               Xcode

Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe




Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe




Thursday, 10 March 2011
iPhone development a brief introduction         pete goodliffe




                                         an iPhone

Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe




                           Interface Builder

Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe




                          iPhone simulator

Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe




                          Instruments/Shark

Thursday, 10 March 2011
iPhone development a brief introduction         pete goodliffe




                                       Other tools

Thursday, 10 March 2011
iPhone development a brief introduction               pete goodliffe




                             Getting set up...
                                     Get a Mac
                                   Get the tools
                                      Install
                                Get an ADC account   $$$
                                       Code
                                         …
                                       Profit


Thursday, 10 March 2011
iPhone development a brief introduction                                                       pete goodliffe




   in 90 minutes...                                     Demo           Intro
               ‣ Intro
               ‣ The tools                       Tips                                    Tools
               ‣ The language
               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                           Language

               ‣ Tips and tricks                        Deploying
               ‣ The demo                                                          UI
                                                                    Technologies




Thursday, 10 March 2011
iPhone development a brief introduction                                                       pete goodliffe




   in 90 minutes...                                     Demo           Intro
               ‣ Intro
               ‣ The tools                       Tips
               ‣ The language                                                      Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                           Language

               ‣ Tips and tricks                        Deploying
               ‣ The demo                                                          UI
                                                                    Technologies




Thursday, 10 March 2011
iPhone development a brief introduction                                                          pete goodliffe




   in 90 minutes...                                     Demo           Intro
               ‣ Intro


               The language
               ‣ The tools                       Tips
               ‣ The language                                                      Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                              Language
               ‣ Tips and tricks                        Deploying
               ‣ The demo                                                          UI
                                                                    Technologies




Thursday, 10 March 2011
iPhone development a brief introduction                 pete goodliffe




                          (well, languages)
                                                   C
                                                  C++
                                               Objective-C




Thursday, 10 March 2011
iPhone development a brief introduction                 pete goodliffe




                          (well, languages)
                                                   C
                                                  C++
                                               Objective-C




Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe




Thursday, 10 March 2011
iPhone development a brief introduction                    pete goodliffe




                              a history of
                            objective-c in 14
                          lines and 12 words
                                               (give or take)




Thursday, 10 March 2011
iPhone development a brief introduction                               pete goodliffe


                                                  algol


                           CPL                               Simula

                          BCPL                  Smalltalk
                           B
                           C
                                               Objective-C
                                                                 C++


                                                          Java    C#   D

Thursday, 10 March 2011
iPhone development a brief introduction                   pete goodliffe



                                objective C is...
                                        dynamic
                              based on message passing
                             follows C compilation model
                                   full of [ ] and @s

                                                            ot too
                                                           n
          - (id) thisIsAMethod:(int)param1                      ry!
                     signature:(float)param2                sca
          {
              for (int n (brace n < 10; ++n)
                          = 0; yourself)
              {
                  NSLog(@”N=%d”, n);
                  [object callMethod:1 thing:2];
              }
          }
Thursday, 10 March 2011
iPhone development a brief introduction             pete goodliffe

                                               .m file

        @implementation MyClass

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

        @end



Thursday, 10 March 2011
iPhone development a brief introduction     pete goodliffe




        @implementation MyClass

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

        @end



Thursday, 10 March 2011
iPhone development a brief introduction     pete goodliffe




        @implementation MyClass

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

        @end



Thursday, 10 March 2011
iPhone development a brief introduction     pete goodliffe




        @implementation MyClass

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

        @end



Thursday, 10 March 2011
iPhone development a brief introduction     pete goodliffe




        @implementation MyClass

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

        @end



Thursday, 10 March 2011
iPhone development a brief introduction             pete goodliffe




        @implementation MyClass

        - (id) thisIsAMethod:(int)param1
                   signature:(float)param2
                                    C an
        {                                stil
                                              l
                                        C fr write
            for (int n = 0; n < 10; ++n)ee func (and c
                                                   tion all)
            {                                          s

                NSLog(@”N=%d”, n);
                [object callMethod:1 thing:2];
            }
        }

        @end



Thursday, 10 March 2011
iPhone development a brief introduction     pete goodliffe




        @implementation MyClass

        - (id) thisIsAMethod:(int)param1
                   signature:(float)param2
        {
            for (int n = 0; n < 10; ++n)
            {
                NSLog(@”N=%d”, n);
                               NSS
                [object callMethod:1 thing:2];
                                   tri
            }                          ng
        }

        @end



Thursday, 10 March 2011
iPhone development a brief introduction     pete goodliffe




        @implementation MyClass

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

        @end



Thursday, 10 March 2011
iPhone development a brief introduction      pete goodliffe




        @implementation MyClass

        - (id) thisIsAMethod:(int)param1
                    signature:(float)param2
        {
             for (int n = 0; n < 10; ++n)
             {
                 NSLog(@”N=%d”, n);
                 [object callMethod:1 thing:2];
             }                  Can
        }                           call
                                         nil
        @end



Thursday, 10 March 2011
iPhone development a brief introduction                pete goodliffe



                                               Sending messages

                [object method];
        int i = [object method];
               [[object method1] method2];

                           [object method:10];
                           [object1 method:[object 2:method]];




Thursday, 10 March 2011
iPhone development a brief introduction                                   pete goodliffe



                                                        Method names
                                                                  parameters

                   object


                          [circle setCenterAtX:110 y:675];

                                               method name

                              selector name is: setCenterAtX:y:


                                                method declared as:
            - (void) setCentreAtX:(float)x y:(float)y

                      SEL s = @selector(setCenterAtX:y:);
                      [circle performSelector:s];
Thursday, 10 March 2011
iPhone development a brief introduction                  pete goodliffe




                          parameter types:
                                  int, float, unsigned, etc
                                   syntax: (return type)
                                               id




Thursday, 10 March 2011
iPhone development a brief introduction             pete goodliffe
                                               .h file

        @class ForwardDeclaration;

        @interface MyClass : NSObject
        {
            ForwardDeclaration *member;
            bool                otherMember;
        }

        - (id) init;
        - (id) initWithItems:(NSArray*)array
                     enabled:(bool)enabled;

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

        @end
Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe



        @class ForwardDeclaration;

        @interface MyClass : NSObject
        {
            ForwardDeclaration *member;
            bool                otherMember;
        }

        - (id) init;
        - (id) initWithItems:(NSArray*)array
                     enabled:(bool)enabled;

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

        @end
Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe



        @class ForwardDeclaration;

        @interface MyClass : NSObject
        {
            ForwardDeclaration *member;
            bool                otherMember;
        }

        - (id) init;
        - (id) initWithItems:(NSArray*)array
                     enabled:(bool)enabled;

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

        @end
Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe



        @class ForwardDeclaration;

        @interface MyClass : NSObject
        {
            ForwardDeclaration *member;
            bool                otherMember;
        }

        - (id) init;
        - (id) initWithItems:(NSArray*)array
                     enabled:(bool)enabled;

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

        @end
Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe



        @class ForwardDeclaration;

        @interface MyClass : NSObject
        {
            ForwardDeclaration *member;
            bool                otherMember;
        }

        - (id) init;
        - (id) initWithItems:(NSArray*)array
                     enabled:(bool)enabled;

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

        @end
Thursday, 10 March 2011
iPhone development a brief introduction      pete goodliffe



        @class ForwardDeclaration;

        @interface MyClass : NSObject
        {
            ForwardDeclaration *member;
            bool                   otherMember;
        }
                             nda nt)
                       (redu
        - (id) init;
        - (id) initWithItems:(NSArray*)array
                     enabled:(bool)enabled;

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

        @end
Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe



        @class ForwardDeclaration;

        @interface MyClass : NSObject
        {
            ForwardDeclaration *member;
            bool                otherMember;
        }

        - (id) init;
        - (id) initWithItems:(NSArray*)array
                     enabled:(bool)enabled;

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

        @end
Thursday, 10 March 2011
iPhone development a brief introduction                    pete goodliffe




                                 Objective C++
                                     In .mm files
                           Classes can contain C++ objects
                          May use C++ constructs in functions
                                   You can use RAII
                                    C++ libraries


Thursday, 10 March 2011
iPhone development a brief introduction                         pete goodliffe



  Properties
                          @interface MyClass
                          {
                               int harold;
                          }
                          @property (nonatomic) int harold;
                          @end


                In MyClass.m...
                  @interface MyClass
                  @synthesize harold;
                  @end
                                                         This will become
                                                       important when we
                                                       look at creating UIs


Thursday, 10 March 2011
iPhone development a brief introduction               pete goodliffe




                          The tao of objects
                              You don’t call methods
                            You pass messages to objects

                      [theObject sendMessage:parameter];



Thursday, 10 March 2011
iPhone development a brief introduction                                        pete goodliffe


                                                              Java, C++, C#
        object.myMethod(1066);

                                                MyClass

                                          myMethod(int)
                                                                    MyClass *this
                                          another()

                                          more()
                                                               class MyClass
                                                               {
                                               private data        public myMethod(int i)
                                                                   {
                                                                       // ...
                                                                   }
                                                               };



Thursday, 10 March 2011
iPhone development a brief introduction                                        pete goodliffe


                                                                Objective-C
        [object myMethod:1066];

                                                  MyClass
                     message
                      (selector)
                                                                   MyClass *self

                                               myMethod(int)

                                               another()
                                                                 @implementation MyClass
                                                                 - (void) myMethod:(int)i
                                                 private data    {
                                                                    // ...
                                                                 }
                                                                 @end




Thursday, 10 March 2011
iPhone development a brief introduction        pete goodliffe



  Categories

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



                NSArray *array = [NSArray array];
                [array extraFooMethod];




Thursday, 10 March 2011
iPhone development a brief introduction                                 pete goodliffe



                                                     Object lifetime
                                               All objects are reference counted
                                                                    (the retain count)




       NSArray *array1 = [[NSArray alloc] init];
       NSArray *array2 = [NSArray array];

       [array1 release];
       [array2 release]; // wrong

       Circle *circle = [[Circle alloc] initAtCenterX:100
                                                    y:100
                                               radius:200];


Thursday, 10 March 2011
iPhone development a brief introduction                                 pete goodliffe




                                                                    Retain
                                               Action               count



                obj=[[ClassType alloc] init];                         1


                                                    [obj retain];     2


                [obj release];                                        1


                                                   [obj release];     0

                                                           [object dealloc];
Thursday, 10 March 2011
iPhone development a brief introduction                 pete goodliffe



                                               The usual suspects

               NSObject
               NSString
               NSArray       NSMutableArray
               NSNumber
               NSThread
               NSDictionary NSMutableDictionary
               NSApplication
               NSData        NSMutableData
               NSURL
               NSSet         NSMutableSet
               NSValue


Thursday, 10 March 2011
iPhone development a brief introduction                pete goodliffe




                                               Miscellany


                Statically typed my arse
                        #import
                 Constructor kludgery



Thursday, 10 March 2011
iPhone development a brief introduction                   pete goodliffe




                                               Idioms

                               Delegates
                           Key-value coding
                          Protocol (interfaces)
                                         formal and informal




Thursday, 10 March 2011
iPhone development a brief introduction                                   pete goodliffe




                                   The libraries
                   Objective C
                                               Cocoa Touch             UIKit, etc


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


                                               Core Services

                                                 Core OS          Posix, SQLite, Core
                                                                   Foundation, BSD
                          C




Thursday, 10 March 2011
iPhone development a brief introduction                                                          pete goodliffe




   in 90 minutes...                                     Demo           Intro
               ‣ Intro
               ‣ The tools                       Tips
               ‣ The language                                                      Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                              Language
               ‣ Tips and tricks                        Deploying
               ‣ The demo                                                          UI
                                                                    Technologies




Thursday, 10 March 2011
iPhone development a brief introduction                                                       pete goodliffe




   in 90 minutes...                                     Demo           Intro
               ‣ Intro
               ‣ The tools                       Tips
               ‣ The language                                                      Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                           Language

               ‣ Tips and tricks                        Deploying
               ‣ The demo                                                          UI
                                                                    Technologies




Thursday, 10 March 2011
iPhone development a brief introduction                                                    pete goodliffe




   in 90 minutes...                                     Demo           Intro
               ‣ Intro


                                       The UI
               ‣ The tools                       Tips
               ‣ The language                                                      Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                        Language

               ‣ Tips and tricks                        Deploying
               ‣ The demo
                                                                    Technologies
                                                                                      UI




Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe




                           Interface Builder

Thursday, 10 March 2011
iPhone development a brief introduction                     pete goodliffe




                                     Held in .xib files
                                               (Compiled NIBs)

                            Loaded into application
                             (semi-automatically)

                          IB is tightly integrated with
                                      Xcode

                                   UIKit framework


Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe




Thursday, 10 March 2011
iPhone development a brief introduction               pete goodliffe




                                 Create UI elements

                          Link to an object reference in
                           the XIB through properties
                               marked as IBOutlet

                            Link actions to methods
                               defined IBAction


Thursday, 10 March 2011
iPhone development a brief introduction                                          pete goodliffe




        //
        //     ExampleAppDelegate.h
        //     Example
        //
        //     Created by Pete Goodliffe on 03/04/2010.
        //     Copyright __MyCompanyName__ 2010. All rights reserved.
        //

        #import <UIKit/UIKit.h>

        @interface ExampleAppDelegate : NSObject <UIApplicationDelegate> {

               UIWindow *window;
               UINavigationController *navigationController;
        }

        @property (nonatomic, retain) IBOutlet UIWindow *window;
        @property (nonatomic, retain) IBOutlet UINavigationController *navigationController;

        @end




Thursday, 10 March 2011
iPhone development a brief introduction                                                    pete goodliffe




   in 90 minutes...                                     Demo           Intro
               ‣ Intro
               ‣ The tools                       Tips
               ‣ The language                                                      Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                        Language

               ‣ Tips and tricks                        Deploying
               ‣ The demo
                                                                    Technologies
                                                                                      UI




Thursday, 10 March 2011
iPhone development a brief introduction                                                       pete goodliffe




   in 90 minutes...                                     Demo           Intro
               ‣ Intro
               ‣ The tools                       Tips
               ‣ The language                                                      Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                           Language

               ‣ Tips and tricks                        Deploying
               ‣ The demo                                                          UI
                                                                    Technologies




Thursday, 10 March 2011
iPhone development a brief introduction                                                       pete goodliffe




   in 90 minutes...
               ‣ Intro
                        Key
               ‣ The tools
               ‣ The language
               ‣ The UI
                                                 Tips
                                                        Demo         Intro




                                                                                   Tools




                    technologies
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                           Language

               ‣ Tips and tricks                        Deploying
               ‣ The demo                                                          UI


                                                                    Technologies




Thursday, 10 March 2011
iPhone development a brief introduction          pete goodliffe




                                    UIKit
                                Core Graphics
                                 Core Audio
                          Media Core / AVFoundation
                           MapKit / Core Location
                             CoreData (or sqlite)
                                 OpenGL ES
                             External Accessory


Thursday, 10 March 2011
iPhone development a brief introduction                                                       pete goodliffe




   in 90 minutes...                                     Demo         Intro
               ‣ Intro
               ‣ The tools                       Tips
               ‣ The language                                                      Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                           Language

               ‣ Tips and tricks                        Deploying
               ‣ The demo                                                          UI


                                                                    Technologies




Thursday, 10 March 2011
iPhone development a brief introduction                                                       pete goodliffe




   in 90 minutes...                                     Demo           Intro
               ‣ Intro
               ‣ The tools                       Tips
               ‣ The language                                                      Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                           Language

               ‣ Tips and tricks                        Deploying
               ‣ The demo                                                          UI
                                                                    Technologies




Thursday, 10 March 2011
iPhone development a brief introduction                                                       pete goodliffe




   in 90 minutes...                                      Demo          Intro
               ‣ Intro


                          Deploying
               ‣ The tools                       Tips
               ‣ The language                                                      Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                           Language

               ‣ Tips and tricks
               ‣ The demo                               Deploying
                                                                                   UI
                                                                    Technologies




Thursday, 10 March 2011
iPhone development a brief introduction                                   pete goodliffe




                          Deploying
                     iPhone
                   simulator                                   iPhone

                                                          developer account ($$$)
                       free
                                                                “DRM hell”
                       x86
                                                          Deployment certificates
              runs at desktop speed
                                  different build targets   100 devices per year
                 more memory
                     network stable
                                                App
                                               store      iTunes Connect
                                                          Another build type

Thursday, 10 March 2011
iPhone development a brief introduction                  pete goodliffe




                                                   App
                                                  store

                                                 submit

                                               get rejected

                                                  fix it

                                                resubmit


                                                 profit

Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe




Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe




Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe




Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe




Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe




Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe




Thursday, 10 March 2011
iPhone development a brief introduction   pete goodliffe




Thursday, 10 March 2011
iPhone development a brief introduction                                                       pete goodliffe




   in 90 minutes...                                      Demo          Intro
               ‣ Intro
               ‣ The tools                       Tips
               ‣ The language                                                      Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                           Language

               ‣ Tips and tricks
               ‣ The demo                               Deploying
                                                                                   UI
                                                                    Technologies




Thursday, 10 March 2011
iPhone development a brief introduction                                                       pete goodliffe




   in 90 minutes...                                     Demo           Intro
               ‣ Intro
               ‣ The tools                       Tips
               ‣ The language                                                      Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                           Language

               ‣ Tips and tricks                        Deploying
               ‣ The demo                                                          UI
                                                                    Technologies




Thursday, 10 March 2011
iPhone development a brief introduction                                                             pete goodliffe




   in 90 minutes...                                           Demo           Intro
               ‣ Intro


                      Further info
               ‣ The tools                            Tips
               ‣ The language                                                            Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                                 Language

               ‣ Tips and tricks                              Deploying
               ‣ The demo                                                                UI
                                                                          Technologies




Thursday, 10 March 2011
iPhone development a brief introduction                            pete goodliffe




                             Xcode documentation
                          developer.apple.com/iphone
                                     Books
                                   Websites
                                        Stack Overflow, CocoaDev, ADC

                              Videos on iTunes U
                          http://itunes.stanford.edu/



Thursday, 10 March 2011
iPhone development a brief introduction                                                             pete goodliffe




   in 90 minutes...                                           Demo           Intro
               ‣ Intro
               ‣ The tools                            Tips
               ‣ The language                                                            Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                                 Language

               ‣ Tips and tricks                              Deploying
               ‣ The demo                                                                UI
                                                                          Technologies




Thursday, 10 March 2011
iPhone development a brief introduction                                                       pete goodliffe




   in 90 minutes...                                     Demo           Intro
               ‣ Intro
               ‣ The tools                       Tips
               ‣ The language                                                      Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                           Language

               ‣ Tips and tricks                        Deploying
               ‣ The demo                                                          UI
                                                                    Technologies




Thursday, 10 March 2011
iPhone development a brief introduction                                                      pete goodliffe




   in 90 minutes...
               ‣ Intro
               ‣ The tools  Tips
               ‣ The language
               ‣ The UI
                                               Tips
                                                         Demo            Intro




                                                                                     Tools




                          and tricks
               ‣ Key technologies
               ‣ Deploying                       Further info

               ‣ Further info                                                          Language

               ‣ Tips and tricks                          Deploying
               ‣ The demo                                                            UI
                                                                      Technologies




Thursday, 10 March 2011
iPhone development a brief introduction          pete goodliffe




                                    Thinking iPhone




Thursday, 10 March 2011
iPhone development a brief introduction                          pete goodliffe




                                      Get the UI right
                                                  HIG
                                         resource conservation
                                     (alpha blending, prerendering)
                                               asynchrony




Thursday, 10 March 2011
iPhone development a brief introduction          pete goodliffe




                          The network is not always
                                  available




Thursday, 10 March 2011
iPhone development a brief introduction             pete goodliffe




                               Do not write to disk
                                               (often)




Thursday, 10 March 2011
iPhone development a brief introduction                pete goodliffe




                                Conserve resources
                                                  RAM
                                                   CPU
                                               filesystem




Thursday, 10 March 2011
iPhone development a brief introduction                                                      pete goodliffe




   in 90 minutes...                                      Demo            Intro
               ‣ Intro
               ‣ The tools                     Tips

               ‣ The language                                                        Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                       Further info

               ‣ Further info                                                          Language

               ‣ Tips and tricks                          Deploying
               ‣ The demo                                                            UI
                                                                      Technologies




Thursday, 10 March 2011
iPhone development a brief introduction                                                       pete goodliffe




   in 90 minutes...                                     Demo           Intro
               ‣ Intro
               ‣ The tools                       Tips
               ‣ The language                                                      Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                           Language

               ‣ Tips and tricks                        Deploying
               ‣ The demo                                                          UI
                                                                    Technologies




Thursday, 10 March 2011
iPhone development a brief introduction                                                       pete goodliffe




   in 90 minutes...                                  Demo

                                                                       Intro
               ‣ Intro


                          The demo
               ‣ The tools                       Tips
               ‣ The language                                                      Tools

               ‣ The UI
               ‣ Key technologies
               ‣ Deploying                     Further info

               ‣ Further info                                                           Language

               ‣ Tips and tricks                        Deploying
               ‣ The demo                                                          UI
                                                                    Technologies




Thursday, 10 March 2011
iPhone development a brief introduction      pete goodliffe




                                (wish me luck)
                                   wasn’t that
                                   marvellous?!



Thursday, 10 March 2011
iPhone development a brief introduction           pete goodliffe




                                               Pete Goodliffe
                                               pete@goodliffe.net
Thursday, 10 March 2011

More Related Content

PDF
iPhone development: A brief introduction
PDF
RFID Next Generation Systems & Services
PPTX
PPT
Downs analysis/ dental implant courses
PPT
Facebow/ dental implant courses
PPT
Kameda technique
PPT
Current controversies in orthodontics
PDF
Smart view instructions_2_7_14
iPhone development: A brief introduction
RFID Next Generation Systems & Services
Downs analysis/ dental implant courses
Facebow/ dental implant courses
Kameda technique
Current controversies in orthodontics
Smart view instructions_2_7_14

Viewers also liked (17)

PPT
Canine rapid retraction - comp analysis
PPTX
Hard tissue cephalometrics
PDF
Portfoli 3r trimestre
PDF
Part 9 anchorage control and distal movement
PPT
Bone anchored pendulum appliance. (2)
PDF
z_remy_spaan
PPT
Arnet facial analysis
PDF
Ch2 lec2 orthodontics "Classifications "
PPT
Modificationsin begg /certified fixed orthodontic courses by Indian dental ac...
PPT
Refined begg technique
PPTX
파이썬 데이터 검색
PPTX
Posteroanterior radiogram
PDF
Ch1 lec2 Orthodontics Introduction
PPTX
파이썬+클래스+구조+이해하기 20160310
PPT
Development of face and oral cavity 4 /certified fixed orthodontic courses by...
PPT
Diagnostic records /certified fixed orthodontic courses by Indian dental acad...
PPTX
Diagnostico en Cefalometria
Canine rapid retraction - comp analysis
Hard tissue cephalometrics
Portfoli 3r trimestre
Part 9 anchorage control and distal movement
Bone anchored pendulum appliance. (2)
z_remy_spaan
Arnet facial analysis
Ch2 lec2 orthodontics "Classifications "
Modificationsin begg /certified fixed orthodontic courses by Indian dental ac...
Refined begg technique
파이썬 데이터 검색
Posteroanterior radiogram
Ch1 lec2 Orthodontics Introduction
파이썬+클래스+구조+이해하기 20160310
Development of face and oral cavity 4 /certified fixed orthodontic courses by...
Diagnostic records /certified fixed orthodontic courses by Indian dental acad...
Diagnostico en Cefalometria
Ad

Similar to iOS Development (BCS Edinburgh 2011-03-09) (20)

PDF
iOS Development (BCS Newcastle)
PDF
iPhone Development Overview
PDF
The Lean Tech Stack
KEY
Why Do Mobile Projects Fail?
PDF
Building Awesome Products (BayCHI)
PPTX
iOS intro
KEY
Introduction to iPhone App Development - midVentures DESIGN+DEVELOP
KEY
Life Cycle of an iPhone App
PDF
"Startups, comment gérer une équipe de développeurs" par Laurent Cerveau
PDF
iPhone App from concept to product
PDF
Java programming basics
PDF
Building windows phone_apps_-_a_developers_guide_v7_no_cover
PPT
Interaction design process in human Computer Interface(Human computer interac...
PDF
Flex For Java Developers - SDForum Java SIG
KEY
Life cycle of iPhone application
PDF
Innovative product development - how to use technology demonstrators for busi...
PPTX
Consider Starting Small
PDF
YOW Mobile Night 2011 - The realestate.com.au mobile story
PDF
iPhone App Dev Overview - Mobile Dev Camp Vietnam 1
PDF
Preparing for Release to the App Store
iOS Development (BCS Newcastle)
iPhone Development Overview
The Lean Tech Stack
Why Do Mobile Projects Fail?
Building Awesome Products (BayCHI)
iOS intro
Introduction to iPhone App Development - midVentures DESIGN+DEVELOP
Life Cycle of an iPhone App
"Startups, comment gérer une équipe de développeurs" par Laurent Cerveau
iPhone App from concept to product
Java programming basics
Building windows phone_apps_-_a_developers_guide_v7_no_cover
Interaction design process in human Computer Interface(Human computer interac...
Flex For Java Developers - SDForum Java SIG
Life cycle of iPhone application
Innovative product development - how to use technology demonstrators for busi...
Consider Starting Small
YOW Mobile Night 2011 - The realestate.com.au mobile story
iPhone App Dev Overview - Mobile Dev Camp Vietnam 1
Preparing for Release to the App Store
Ad

More from Pete Goodliffe (14)

PDF
Becoming a Better Programmer
PDF
Words in Code
PDF
Running Effective Worship Rehearsals
PDF
Becoming a Better Programmer (2013)
PDF
Design Sins
PDF
Advanced iOS
PDF
Version Control Done Right
PDF
Getting Into Git
PDF
C++: The Cathedral and the Bizarre
PDF
Three Objectionable Things
PDF
Coping with Complexity
PDF
Manyfestos
PDF
Stood at the bottom of a mountain looking up
PDF
Legacy Code: Learning To Live With It
Becoming a Better Programmer
Words in Code
Running Effective Worship Rehearsals
Becoming a Better Programmer (2013)
Design Sins
Advanced iOS
Version Control Done Right
Getting Into Git
C++: The Cathedral and the Bizarre
Three Objectionable Things
Coping with Complexity
Manyfestos
Stood at the bottom of a mountain looking up
Legacy Code: Learning To Live With It

Recently uploaded (20)

PDF
WOOl fibre morphology and structure.pdf for textiles
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Chapter 5: Probability Theory and Statistics
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
A Presentation on Touch Screen Technology
PDF
Mushroom cultivation and it's methods.pdf
PDF
DP Operators-handbook-extract for the Mautical Institute
PPTX
A Presentation on Artificial Intelligence
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Getting Started with Data Integration: FME Form 101
PDF
Approach and Philosophy of On baking technology
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Enhancing emotion recognition model for a student engagement use case through...
WOOl fibre morphology and structure.pdf for textiles
cloud_computing_Infrastucture_as_cloud_p
MIND Revenue Release Quarter 2 2025 Press Release
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Hindi spoken digit analysis for native and non-native speakers
Group 1 Presentation -Planning and Decision Making .pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Chapter 5: Probability Theory and Statistics
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
1 - Historical Antecedents, Social Consideration.pdf
A Presentation on Touch Screen Technology
Mushroom cultivation and it's methods.pdf
DP Operators-handbook-extract for the Mautical Institute
A Presentation on Artificial Intelligence
NewMind AI Weekly Chronicles - August'25-Week II
Getting Started with Data Integration: FME Form 101
Approach and Philosophy of On baking technology
Heart disease approach using modified random forest and particle swarm optimi...
Enhancing emotion recognition model for a student engagement use case through...

iOS Development (BCS Edinburgh 2011-03-09)

  • 1. iPhone Edinburgh BCS development a brief introduction pete goodliffe Hello, world! iPhone iOS Development a brief introduction rkably , very rema really, Pete Goodliffe pete@goodliffe.net Thursday, 10 March 2011
  • 2. iPhone development a brief introduction pete goodliffe Pete Goodliffe A programmer, a columnist, an author, a teacher. Someone who cares about code. www.goodliffe.net goodliffe.blogspot.com @petegoodliffe Thursday, 10 March 2011
  • 3. iPhone development a brief introduction pete goodliffe Pete Goodliffe A programmer, a columnist, an author, a teacher. Someone who cares about code. www.goodliffe.net goodliffe.blogspot.com @petegoodliffe Thursday, 10 March 2011
  • 4. iPhone development a brief introduction pete goodliffe Thursday, 10 March 2011
  • 5. iPhone development a brief introduction pete goodliffe talk synopsis An introduction to iPhone/iOS development An introduction to iPhone development for beginners or those who are casually interested and want a leg up the learning curve. This talk is an overview of how to get started as an iPhone developer, and an introduction to the core technologies, including: ‣ Common iPhone/Mac OS design patterns, idioms, and practices ‣ Becoming a native: how to "think in iPhone" ‣ Overview of the libraries and facilities that exist ‣ Limitations of the development environment Thursday, 10 March 2011
  • 6. iPhone development a brief introduction pete goodliffe 90 minutes? is that all?!!! Thursday, 10 March 2011
  • 7. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies m… pie Mm Thursday, 10 March 2011
  • 8. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro Introduction ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 9. iPhone development a brief introduction pete goodliffe who are you? Thursday, 10 March 2011
  • 10. iPhone development a brief introduction pete goodliffe why develop for the iPhone? Thursday, 10 March 2011
  • 11. iPhone development a brief introduction pete goodliffe the alternatives Thursday, 10 March 2011
  • 12. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 13. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 14. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro The tools ‣ The tools Tips Tools ‣ The language ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 15. iPhone development a brief introduction pete goodliffe ❖ The cast ❖ Xcode iPhone/iPod Touch/iPad Interface builder iPhone simulator Instruments/Shark iOS Provisioning Portal Other tools Thursday, 10 March 2011
  • 16. iPhone development a brief introduction pete goodliffe Xcode Thursday, 10 March 2011
  • 17. iPhone development a brief introduction pete goodliffe Thursday, 10 March 2011
  • 18. iPhone development a brief introduction pete goodliffe Thursday, 10 March 2011
  • 19. iPhone development a brief introduction pete goodliffe an iPhone Thursday, 10 March 2011
  • 20. iPhone development a brief introduction pete goodliffe Interface Builder Thursday, 10 March 2011
  • 21. iPhone development a brief introduction pete goodliffe iPhone simulator Thursday, 10 March 2011
  • 22. iPhone development a brief introduction pete goodliffe Instruments/Shark Thursday, 10 March 2011
  • 23. iPhone development a brief introduction pete goodliffe Other tools Thursday, 10 March 2011
  • 24. iPhone development a brief introduction pete goodliffe Getting set up... Get a Mac Get the tools Install Get an ADC account $$$ Code … Profit Thursday, 10 March 2011
  • 25. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro ‣ The tools Tips Tools ‣ The language ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 26. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 27. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro The language ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 28. iPhone development a brief introduction pete goodliffe (well, languages) C C++ Objective-C Thursday, 10 March 2011
  • 29. iPhone development a brief introduction pete goodliffe (well, languages) C C++ Objective-C Thursday, 10 March 2011
  • 30. iPhone development a brief introduction pete goodliffe Thursday, 10 March 2011
  • 31. iPhone development a brief introduction pete goodliffe a history of objective-c in 14 lines and 12 words (give or take) Thursday, 10 March 2011
  • 32. iPhone development a brief introduction pete goodliffe algol CPL Simula BCPL Smalltalk B C Objective-C C++ Java C# D Thursday, 10 March 2011
  • 33. iPhone development a brief introduction pete goodliffe objective C is... dynamic based on message passing follows C compilation model full of [ ] and @s ot too n - (id) thisIsAMethod:(int)param1 ry! signature:(float)param2 sca { for (int n (brace n < 10; ++n) = 0; yourself) { NSLog(@”N=%d”, n); [object callMethod:1 thing:2]; } } Thursday, 10 March 2011
  • 34. iPhone development a brief introduction pete goodliffe .m file @implementation MyClass - (id) thisIsAMethod:(int)param1 signature:(float)param2 { for (int n = 0; n < 10; ++n) { NSLog(@”N=%d”, n); [object callMethod:1 thing:2]; } } @end Thursday, 10 March 2011
  • 35. iPhone development a brief introduction pete goodliffe @implementation MyClass - (id) thisIsAMethod:(int)param1 @class signature:(float)param2 { @interface @implementation for (int n = 0; n < 10; ++n) { @end NSLog(@”N=%d”, n); @property [object callMethod:1 thing:2]; @private } } @protected @end Thursday, 10 March 2011
  • 36. iPhone development a brief introduction pete goodliffe @implementation MyClass - (id) thisIsAMethod:(int)param1 signature:(float)param2 { for (int n = 0; n < 10; ++n) { NSLog(@”N=%d”, n); [object callMethod:1 thing:2]; } } @end Thursday, 10 March 2011
  • 37. iPhone development a brief introduction pete goodliffe @implementation MyClass - (id) thisIsAMethod:(int)param1 signature:(float)param2 { for (int n = 0; n < 10; ++n) { NSLog(@”N=%d”, n); [object callMethod:1 thing:2]; } } @end Thursday, 10 March 2011
  • 38. iPhone development a brief introduction pete goodliffe @implementation MyClass - (id) thisIsAMethod:(int)param1 signature:(float)param2 { for (int n = 0; n < 10; ++n) { NSLog(@”N=%d”, n); [object callMethod:1 thing:2]; } } @end Thursday, 10 March 2011
  • 39. iPhone development a brief introduction pete goodliffe @implementation MyClass - (id) thisIsAMethod:(int)param1 signature:(float)param2 C an { stil l C fr write for (int n = 0; n < 10; ++n)ee func (and c tion all) { s NSLog(@”N=%d”, n); [object callMethod:1 thing:2]; } } @end Thursday, 10 March 2011
  • 40. iPhone development a brief introduction pete goodliffe @implementation MyClass - (id) thisIsAMethod:(int)param1 signature:(float)param2 { for (int n = 0; n < 10; ++n) { NSLog(@”N=%d”, n); NSS [object callMethod:1 thing:2]; tri } ng } @end Thursday, 10 March 2011
  • 41. iPhone development a brief introduction pete goodliffe @implementation MyClass - (id) thisIsAMethod:(int)param1 signature:(float)param2 { for (int n = 0; n < 10; ++n) { NSLog(@”N=%d”, n); [object callMethod:1 thing:2]; } } @end Thursday, 10 March 2011
  • 42. iPhone development a brief introduction pete goodliffe @implementation MyClass - (id) thisIsAMethod:(int)param1 signature:(float)param2 { for (int n = 0; n < 10; ++n) { NSLog(@”N=%d”, n); [object callMethod:1 thing:2]; } Can } call nil @end Thursday, 10 March 2011
  • 43. iPhone development a brief introduction pete goodliffe Sending messages [object method]; int i = [object method]; [[object method1] method2]; [object method:10]; [object1 method:[object 2:method]]; Thursday, 10 March 2011
  • 44. iPhone development a brief introduction pete goodliffe Method names parameters object [circle setCenterAtX:110 y:675]; method name selector name is: setCenterAtX:y: method declared as: - (void) setCentreAtX:(float)x y:(float)y SEL s = @selector(setCenterAtX:y:); [circle performSelector:s]; Thursday, 10 March 2011
  • 45. iPhone development a brief introduction pete goodliffe parameter types: int, float, unsigned, etc syntax: (return type) id Thursday, 10 March 2011
  • 46. iPhone development a brief introduction pete goodliffe .h file @class ForwardDeclaration; @interface MyClass : NSObject { ForwardDeclaration *member; bool otherMember; } - (id) init; - (id) initWithItems:(NSArray*)array enabled:(bool)enabled; + (id) myClassWithItems:(NSArray*)array; @end Thursday, 10 March 2011
  • 47. iPhone development a brief introduction pete goodliffe @class ForwardDeclaration; @interface MyClass : NSObject { ForwardDeclaration *member; bool otherMember; } - (id) init; - (id) initWithItems:(NSArray*)array enabled:(bool)enabled; + (id) myClassWithItems:(NSArray*)array; @end Thursday, 10 March 2011
  • 48. iPhone development a brief introduction pete goodliffe @class ForwardDeclaration; @interface MyClass : NSObject { ForwardDeclaration *member; bool otherMember; } - (id) init; - (id) initWithItems:(NSArray*)array enabled:(bool)enabled; + (id) myClassWithItems:(NSArray*)array; @end Thursday, 10 March 2011
  • 49. iPhone development a brief introduction pete goodliffe @class ForwardDeclaration; @interface MyClass : NSObject { ForwardDeclaration *member; bool otherMember; } - (id) init; - (id) initWithItems:(NSArray*)array enabled:(bool)enabled; + (id) myClassWithItems:(NSArray*)array; @end Thursday, 10 March 2011
  • 50. iPhone development a brief introduction pete goodliffe @class ForwardDeclaration; @interface MyClass : NSObject { ForwardDeclaration *member; bool otherMember; } - (id) init; - (id) initWithItems:(NSArray*)array enabled:(bool)enabled; + (id) myClassWithItems:(NSArray*)array; @end Thursday, 10 March 2011
  • 51. iPhone development a brief introduction pete goodliffe @class ForwardDeclaration; @interface MyClass : NSObject { ForwardDeclaration *member; bool otherMember; } nda nt) (redu - (id) init; - (id) initWithItems:(NSArray*)array enabled:(bool)enabled; + (id) myClassWithItems:(NSArray*)array; @end Thursday, 10 March 2011
  • 52. iPhone development a brief introduction pete goodliffe @class ForwardDeclaration; @interface MyClass : NSObject { ForwardDeclaration *member; bool otherMember; } - (id) init; - (id) initWithItems:(NSArray*)array enabled:(bool)enabled; + (id) myClassWithItems:(NSArray*)array; @end Thursday, 10 March 2011
  • 53. iPhone development a brief introduction pete goodliffe Objective C++ In .mm files Classes can contain C++ objects May use C++ constructs in functions You can use RAII C++ libraries Thursday, 10 March 2011
  • 54. iPhone development a brief introduction pete goodliffe Properties @interface MyClass { int harold; } @property (nonatomic) int harold; @end In MyClass.m... @interface MyClass @synthesize harold; @end This will become important when we look at creating UIs Thursday, 10 March 2011
  • 55. iPhone development a brief introduction pete goodliffe The tao of objects You don’t call methods You pass messages to objects [theObject sendMessage:parameter]; Thursday, 10 March 2011
  • 56. iPhone development a brief introduction pete goodliffe Java, C++, C# object.myMethod(1066); MyClass myMethod(int) MyClass *this another() more() class MyClass { private data public myMethod(int i) { // ... } }; Thursday, 10 March 2011
  • 57. iPhone development a brief introduction pete goodliffe Objective-C [object myMethod:1066]; MyClass message (selector) MyClass *self myMethod(int) another() @implementation MyClass - (void) myMethod:(int)i private data { // ... } @end Thursday, 10 March 2011
  • 58. iPhone development a brief introduction pete goodliffe Categories @interface NSObject (Foo) - (void) extraFooMethod; @end NSArray *array = [NSArray array]; [array extraFooMethod]; Thursday, 10 March 2011
  • 59. iPhone development a brief introduction pete goodliffe Object lifetime All objects are reference counted (the retain count) NSArray *array1 = [[NSArray alloc] init]; NSArray *array2 = [NSArray array]; [array1 release]; [array2 release]; // wrong Circle *circle = [[Circle alloc] initAtCenterX:100 y:100 radius:200]; Thursday, 10 March 2011
  • 60. iPhone development a brief introduction pete goodliffe Retain Action count obj=[[ClassType alloc] init]; 1 [obj retain]; 2 [obj release]; 1 [obj release]; 0 [object dealloc]; Thursday, 10 March 2011
  • 61. iPhone development a brief introduction pete goodliffe The usual suspects NSObject NSString NSArray NSMutableArray NSNumber NSThread NSDictionary NSMutableDictionary NSApplication NSData NSMutableData NSURL NSSet NSMutableSet NSValue Thursday, 10 March 2011
  • 62. iPhone development a brief introduction pete goodliffe Miscellany Statically typed my arse #import Constructor kludgery Thursday, 10 March 2011
  • 63. iPhone development a brief introduction pete goodliffe Idioms Delegates Key-value coding Protocol (interfaces) formal and informal Thursday, 10 March 2011
  • 64. iPhone development a brief introduction pete goodliffe The libraries Objective C Cocoa Touch UIKit, etc Core Audio, Open GL ES, Media Quartz, Core Animation Core Services Core OS Posix, SQLite, Core Foundation, BSD C Thursday, 10 March 2011
  • 65. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 66. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 67. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro The UI ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo Technologies UI Thursday, 10 March 2011
  • 68. iPhone development a brief introduction pete goodliffe Interface Builder Thursday, 10 March 2011
  • 69. iPhone development a brief introduction pete goodliffe Held in .xib files (Compiled NIBs) Loaded into application (semi-automatically) IB is tightly integrated with Xcode UIKit framework Thursday, 10 March 2011
  • 70. iPhone development a brief introduction pete goodliffe Thursday, 10 March 2011
  • 71. iPhone development a brief introduction pete goodliffe Create UI elements Link to an object reference in the XIB through properties marked as IBOutlet Link actions to methods defined IBAction Thursday, 10 March 2011
  • 72. iPhone development a brief introduction pete goodliffe // // ExampleAppDelegate.h // Example // // Created by Pete Goodliffe on 03/04/2010. // Copyright __MyCompanyName__ 2010. All rights reserved. // #import <UIKit/UIKit.h> @interface ExampleAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window; UINavigationController *navigationController; } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet UINavigationController *navigationController; @end Thursday, 10 March 2011
  • 73. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo Technologies UI Thursday, 10 March 2011
  • 74. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 75. iPhone development a brief introduction pete goodliffe in 90 minutes... ‣ Intro Key ‣ The tools ‣ The language ‣ The UI Tips Demo Intro Tools technologies ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 76. iPhone development a brief introduction pete goodliffe UIKit Core Graphics Core Audio Media Core / AVFoundation MapKit / Core Location CoreData (or sqlite) OpenGL ES External Accessory Thursday, 10 March 2011
  • 77. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 78. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 79. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro Deploying ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks ‣ The demo Deploying UI Technologies Thursday, 10 March 2011
  • 80. iPhone development a brief introduction pete goodliffe Deploying iPhone simulator iPhone developer account ($$$) free “DRM hell” x86 Deployment certificates runs at desktop speed different build targets 100 devices per year more memory network stable App store iTunes Connect Another build type Thursday, 10 March 2011
  • 81. iPhone development a brief introduction pete goodliffe App store submit get rejected fix it resubmit profit Thursday, 10 March 2011
  • 82. iPhone development a brief introduction pete goodliffe Thursday, 10 March 2011
  • 83. iPhone development a brief introduction pete goodliffe Thursday, 10 March 2011
  • 84. iPhone development a brief introduction pete goodliffe Thursday, 10 March 2011
  • 85. iPhone development a brief introduction pete goodliffe Thursday, 10 March 2011
  • 86. iPhone development a brief introduction pete goodliffe Thursday, 10 March 2011
  • 87. iPhone development a brief introduction pete goodliffe Thursday, 10 March 2011
  • 88. iPhone development a brief introduction pete goodliffe Thursday, 10 March 2011
  • 89. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks ‣ The demo Deploying UI Technologies Thursday, 10 March 2011
  • 90. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 91. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro Further info ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 92. iPhone development a brief introduction pete goodliffe Xcode documentation developer.apple.com/iphone Books Websites Stack Overflow, CocoaDev, ADC Videos on iTunes U http://itunes.stanford.edu/ Thursday, 10 March 2011
  • 93. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 94. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 95. iPhone development a brief introduction pete goodliffe in 90 minutes... ‣ Intro ‣ The tools Tips ‣ The language ‣ The UI Tips Demo Intro Tools and tricks ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 96. iPhone development a brief introduction pete goodliffe Thinking iPhone Thursday, 10 March 2011
  • 97. iPhone development a brief introduction pete goodliffe Get the UI right HIG resource conservation (alpha blending, prerendering) asynchrony Thursday, 10 March 2011
  • 98. iPhone development a brief introduction pete goodliffe The network is not always available Thursday, 10 March 2011
  • 99. iPhone development a brief introduction pete goodliffe Do not write to disk (often) Thursday, 10 March 2011
  • 100. iPhone development a brief introduction pete goodliffe Conserve resources RAM CPU filesystem Thursday, 10 March 2011
  • 101. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 102. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 103. iPhone development a brief introduction pete goodliffe in 90 minutes... Demo Intro ‣ Intro The demo ‣ The tools Tips ‣ The language Tools ‣ The UI ‣ Key technologies ‣ Deploying Further info ‣ Further info Language ‣ Tips and tricks Deploying ‣ The demo UI Technologies Thursday, 10 March 2011
  • 104. iPhone development a brief introduction pete goodliffe (wish me luck) wasn’t that marvellous?! Thursday, 10 March 2011
  • 105. iPhone development a brief introduction pete goodliffe Pete Goodliffe pete@goodliffe.net Thursday, 10 March 2011