iOS App 101
               And how fun is it ?
                 by tomjpsun




12年7月5日星期四
About me

        • MFC Certificate
        • WDM driver (USB)



12年7月5日星期四
About me

        • MFC Certificate   • Linux driver
        • WDM driver (USB) • iOS App



12年7月5日星期四
About me

        • MFC Certificate   • Linux driver
        • WDM driver (USB) • iOS App



12年7月5日星期四
About me

        • MFC Certificate   • Linux driver
        • WDM driver (USB) • iOS App



12年7月5日星期四
About me

        • MFC Certificate   • Linux driver
        • WDM driver (USB) • iOS App

       Not interest any more


12年7月5日星期四
Agenda
             • Development Environment
             • Objective-C
             • Cocoa
             • Design patterns
             • UX
             • References
12年7月5日星期四
Agenda
             • Development Environment
             • Objective-C
             • Cocoa
             • Design patterns
             • UX
             • References
12年7月5日星期四
Tested combinations

                                XCode
                    iOS ver                 OS X ver
                                 ver


                      5.1         4.3      10.7(Lion)



         • XCode   5.0 below      4.2    10.6.8(Leopard)


                               Strictly depends on


12年7月5日星期四
• https://developer.apple.com/programs/
12年7月5日星期四
iOS Dev Center
  https://developer.apple.com/devcenter/ios/index.action




12年7月5日星期四
Provision profile




              Your Mac   Dev Center
12年7月5日星期四
Demo
             • Create an empty App
             • Browse XCode features
              • organizer
              • project configurations
              • simulator
              • download
              • debug
12年7月5日星期四
Agenda
             • Development Environment
             • Objective-C
             • Cocoa
             • Design patterns
             • UX
             • References
12年7月5日星期四
Object oriented



12年7月5日星期四
Message passing
             [instance method];

             寫 iOS 最先看習慣的就是中括號




12年7月5日星期四
Dynamism
             objective-C runtime library




12年7月5日星期四
.h
             #import <Foundation/Foundation.h>

         @interface Fraction: NSObject
         {
             int numerator;
             int denominator;
         }
         -(void) print;
         -(void) setNumerator: (int) n;
         -(void) setDenominator: (int) d;
         @end




12年7月5日星期四
.m
               #import "Fraction.h"

             @implementation Fraction
             -(void) print
             {
                 NSLog(@"%i/%i", numerator, denominator);
             }
             -(void) setNumerator: (int) n
             {
                 numerator = n;
             }
             -(void) setDenominator: (int) d
             {
                 denominator = d;
             }
             @end




12年7月5日星期四
Multiple arguments
             -(void) setTo: (int) n over: (int) d
         {
              numerator = n;
              denominator = d;
         }


         int main (int argc, char *argv[])
         {
             Fraction *aFraction = [[Fraction alloc] init];
             [aFraction setTo: 1 over: 3];
             [aFraction print];   // -> 1/3
             return 0;
         }




12年7月5日星期四
Class method
         @interface Fraction: NSObject
         {
             int numerator;
             int denominator;
         }

         @interface FractionFactory: NSObject

         +(Fraction*) newFractionWithNumerator: (int)numerator
                      andDenominator: (int)denominator;


         int main (int argc, char *argv[])
         {
             Fraction* f = [FractionFactory
                             newFractionWithNumerator: 1
                             andDenominator: 2];
         }



12年7月5日星期四
Synthesized accessor
             #import <Foundation/Foundation.h>

       @interface Fraction: NSObject
       {
           int numerator;
       }
       -(void) setNumerator: (int) n;      // setter
       -(int) numerator;                   // getter
       @end

                 compiler generates getter/setter
   @interface Fraction: NSObject       @implementation Fraction
   @property numerator;                @synthesis numerator;
   @end                                @end




12年7月5日星期四
Dot accessing property
                 [ instance setPoperty: 2];

                  is equal to

                 instance.property = 2;




12年7月5日星期四
self
             • self like this in C++
                  - (id)init
                  {
                      self = [super init];
                      if (self) {
                          // Custom initialization
                      }
                      return self;
                  }




12年7月5日星期四
id


             • something like void*
             • useful at runtime


12年7月5日星期四
selector
             • name of method , function literal
              • compile time
                 SEL aSelector = @selector(methodName);


              • run time
                 SEL aSelector =   NSSelectorFromString(@"print");

                 NSString* selectorStr =

                       NSStringFromSelector(aSelector);
                 NSLog(@"%@", selectorStr);




12年7月5日星期四
selector
             [friend performSelector:@selector(gossipAbout:)

                 withObject:aNeighbor];



             is equal to

             [friend gossipAbout:aNeighbor];




12年7月5日星期四
Runtime
         library
     彈性:原本在 compile
    time, link time 要做的動
    作,延到 run time 再做


12年7月5日星期四
object A
                -(void)fly


             完全沒有任何繼承關係

                object B
                -(void)fly


             SEL userSelector = NSSelectorFromString(@”fly”);
             [ any performSelector: @selector(userSelector) ];


             any 指向 object A, 就呼叫 A 的 fly
             any 指向 object B, 就呼叫 B 的 fly

12年7月5日星期四
Category
      • extending class (even if you don’t have the
             source)
   #import "High.h"

   @interface High (calculate)
   - (NSInteger) plus:(NSInteger)operand1 and:(NSInteger)operand2;
   @end


  @implementation High (calculate)
  - (NSInteger) plus:(NSInteger)operand1 and:(NSInteger)operand2
  {
      return operand1 + operand2;
  }
  @end


12年7月5日星期四
Class extension
             • category without name
             • used as private method declaration in Obj-
               C




12年7月5日星期四
Category may cause
                     chaos

             • category wins over the override function
             • define same function in different
               categories. Lead to undefined condition.




12年7月5日星期四
@protocol

             • class with only methods.
             • classes 之間說好要提供哪些 functions.
         @protocol MyXMLSupport

         - initFromXMLRepresentation:(NSXMLElement *)XMLElement;

         - (NSXMLElement *)XMLRepresentation;

         @end



12年7月5日星期四
memory management

             • MRC - manual reference counting
             • ARC - automatic reference counting
             • garbage collection - in OS X, not in iOS


12年7月5日星期四
MRC
             • Apple’s rule - owner release (owner: copy,
               alloc, retain)
             • burden on developers
             // retain release pair
             id value = [dict retain];
             [value release];

             // autorelease
             array = [[NSMutableArray new] autorelease];




12年7月5日星期四
ARC


             • supported on LLVM 3.0
             • generate release code for you.


12年7月5日星期四
Blocks
         this section is borrowed from WWDC 2011, sec. “block
                            and central dispatch”




                 * ^
12年7月5日星期四
Functions                   Blocks
       // body of code            // body of code
       {                          {

             return   a - b;          return   a - b;

       }                          }

       // pointer to a function   // pointer to a block
       *                          ^




12年7月5日星期四
Functions                   Blocks
       // body of code            // body of code
       {                          {

             return   a - b;          return   a - b;

       }                          }

       // pointer to a function   // pointer to a block
       int (*cmpr)(int, int);     int (^cmpr)(int, int);




12年7月5日星期四
Functions                   Blocks
       // body of code            // body of code
       {                          {

             return   a - b;          return   a - b;

       }                          }

       // pointer to a function   // pointer to a block
       int (*cmpr)(int, int);     int (^cmpr)(int, int);

       typedef int (*func_t)      typedef int (^block_t)
       (int, int);                (int, int);




12年7月5日星期四
Functions                   Blocks
       // body of code            // body of code
       {                          {

             return   a - b;          return   a - b;

       }                          }

       // pointer to a function   // pointer to a block
       int (*cmpr)(int, int);     int (^cmpr)(int, int);

       typedef int (*func_t)      typedef int (^block_t)
       (int, int);                (int, int);

       func_t cmpr = arg;         block_t cmpr = arg;




12年7月5日星期四
Functions                   Blocks
       // body of code            // body of code
       {                          {

             return   a - b;          return    a - b;

       }                          }

       // pointer to a function   // pointer to a block
       int (*cmpr)(int, int);     int (^cmpr)(int, int);

       typedef int (*func_t)      typedef int (^block_t)
       (int, int);                (int, int);

       func_t cmpr = arg;         block_t cmpr = arg;

       cmpr(x, y);                cmpr(x, y);




12年7月5日星期四
Functions                   Blocks
       // body of code            // body of code
       {                          {

             return   a - b;          return   a - b;

       }                          }

       // pointer to a function   // pointer to a block
       *                          ^




12年7月5日星期四
Functions                   Blocks
       // body of code            // body of code
       int my_cmp(int a, int b)   ^(int a, int b)
       {                          {

             return   a - b;          return   a - b;

       }                          }




12年7月5日星期四
Functions                   Blocks
       // body of code            // body of code

       int my_cmp(int a, int b)   ^(int a, int b)
       {                          {

             return   a - b;          return   a - b;

       }                          }

       // usage                   // usage

       sort(array, 10, my_cmp);   sort(array, 10, ^(int a,
                                  int b)
                                  {
                                         return a - b;
                                  });




12年7月5日星期四
closure          Blocks
                       // body of code

                       ^(int a, int b)
                       {

                           return   a - b;

                       }




12年7月5日星期四
closure         Blocks
                       // body of code
                       __block int cnt = 0;
                       ^(int a, int b)
                       {
                           cnt++ ;
                           return a - b;

                       }


                       log(“Count: %d”, cnt);




12年7月5日星期四
Agenda
             • Development Environment
             • Objective-C
             • Cocoa
             • Design patterns
             • UX
             • References
12年7月5日星期四
Cocoa fit in iOS




             不管任何種類的 App,⼀一定會用到 UIKit

12年7月5日星期四
UIKit Philosophy
             • MVC




12年7月5日星期四
View Controllers




12年7月5日星期四
Anatomy




12年7月5日星期四
View Controllers
               Manage Views




12年7月5日星期四
View Controllers
               Manage Views




12年7月5日星期四
View Controllers
               Manage Views




12年7月5日星期四
View




12年7月5日星期四
Important Documents



             View Controller Programming Guide for iOS
             View Programming Guide



12年7月5日星期四
Agenda
             • Development Environment
             • Objective-C
             • Cocoa
             • Design patterns
             • UX
             • References
12年7月5日星期四
delegate
                   iOS
               UIApplication
                  object




                                   MyApp
              delegate
      implemented via @protocol

12年7月5日星期四
delegate
                   iOS
               UIApplication
                  object




             App 可以開始嗎?
                                   MyApp
              delegate
      implemented via @protocol

12年7月5日星期四
delegate
                   iOS
               UIApplication
                  object




             App 可以開始嗎?
                                   MyApp
              delegate
      implemented via @protocol

12年7月5日星期四
delegate
                   iOS
               UIApplication
                  object
                                  可以


             App 可以開始嗎?
                                   MyApp
              delegate
      implemented via @protocol

12年7月5日星期四
delegate
                   iOS
               UIApplication
                  object




                                   MyApp
              delegate
      implemented via @protocol

12年7月5日星期四
delegate
                   iOS
               UIApplication
                  object




             App 將要結束!
                                   MyApp
              delegate
      implemented via @protocol

12年7月5日星期四
delegate
                   iOS         不用回答,因為只
               UIApplication
                  object
                               是知會你的 App



             App 將要結束!
                                   MyApp
              delegate
      implemented via @protocol

12年7月5日星期四
delegate
                   iOS
               UIApplication
                  object



             @protocol

                                   MyApp
              delegate
      implemented via @protocol

12年7月5日星期四
delegate
                   iOS
               UIApplication
                  object          some delegates
                                    are optional


             @protocol

                                        MyApp
              delegate
      implemented via @protocol

12年7月5日星期四
delegate


             • no need to subclassing everywhere.
             • de-coupling decision, cleaner design.


12年7月5日星期四
delegate demo


             https://github.com/tomjpsun/TestObjc.git


12年7月5日星期四
Data-Source
             • nearly the same as delegate, 但是提供 data
               而非 UI 決策.

                     有幾個 sections ?

                             4
                                        TableView
                        sec 1 cell 1    Controller
                      “Clear History”




12年7月5日星期四
Data-Source
             • nearly the same as delegate, 但是提供 data
               而非 UI 決策.

                     有幾個 sections ?

                             4
                                        TableView    Data Source
                        sec 1 cell 1    Controller
                      “Clear History”




12年7月5日星期四
Target-Action
                                                                Button
                              send message when the
                                   event occurs
                                                           ViewController
                                                         -(void)myButtonPressed:
             - (void)viewDidLoad
             {
                [super viewDidLoad];
             ! [self.myButton addTarget:self
             action:@selector(myButtonPressed:)
             forControlEvents:UIControlEventTouchUpInside];
             }

             - (void)myButtonPressed:(UIButton*)button
             {
                 ...
             }

12年7月5日星期四
Notification
                                                     observer 1

                               Notification
             anObject                                observer 2
                                Center
                       post
                    notification                      observer 3
                                        broadcast
                                       notification

                        reduce the code coupling


12年7月5日星期四
Singleton
                                                                   request 1
                                    request 1
                                                                   response 1
             Typical class response 1 A             Singleton
                                                                                A
                                                                response 2
                                        request 2
                      response 2
                                    B                               request 2




              • 系統內,只能有⼀一份 instance,以某種標
                 準的 shared 方式共用之.


12年7月5日星期四
Singleton

             • 是好的 design pattern ? 正反面討論很多
             • Cocoa 很多用到 singleton pattern
              Notification
                            UIApplication   NSFileManager
               Center




12年7月5日星期四
Agenda
             • Development Environment
             • Objective-C
             • Cocoa
             • Design patterns
             • UX
             • References
12年7月5日星期四
abstract from the “Tap Worthy” book


             Get it done quick

                      你想要做的




12年7月5日星期四
abstract from the “Tap Worthy” book


             Get it done quick

                      你想要做的




12年7月5日星期四
abstract from the “Tap Worthy” book


             Get it done quick

                      你想要做的




                      使用者實際需要的



12年7月5日星期四
abstract from the “Tap Worthy” book


               依使用習慣分類

             • 微任務化
             • 找在地資訊
             • 排遣無聊


12年7月5日星期四
abstract from the “Tap Worthy” book


               拇指習慣




             左上和右上角,比較不容易按

12年7月5日星期四
abstract from the “Tap Worthy” book


              神奇的 44




             手指可觸碰到的最小的限度
12年7月5日星期四
Agenda
             • Development Environment
             • Objective-C
             • Cocoa
             • Design patterns
             • UX
             • References
12年7月5日星期四
Agenda
             • Development Environment
             • Objective-C
             • Cocoa
             • Design patterns
             • UX
             • References 勸敗時間到了 !
12年7月5日星期四
Objective-C 入門




         http://www.amazon.com/Programming-Objective-C-2-0-2nd-Edition/dp/0321566157




12年7月5日星期四
Cocoa 入門




       http://www.amazon.com/Cocoa-Design-Patterns-Erik-Buck/dp/0321535022/ref=sr_1_1?
          s=books&ie=UTF8&qid=1341483494&sr=1-1&keywords=cocoa+design+patterns



12年7月5日星期四
Online Videos



             • CS193p in iTunes U(niversity)


12年7月5日星期四
User Experience




         http://www.amazon.com/Tapworthy-Designing-Great-iPhone-Apps/dp/1449381650/
          ref=sr_1_1?s=books&ie=UTF8&qid=1341483149&sr=1-1&keywords=tapworthy




12年7月5日星期四
唯⼀一免費的


                XCode documents




12年7月5日星期四
唯⼀一免費的


                 XCode documents




              免費的最硬

12年7月5日星期四
Q &A




12年7月5日星期四

iOs app 101

  • 1.
    iOS App 101 And how fun is it ? by tomjpsun 12年7月5日星期四
  • 2.
    About me • MFC Certificate • WDM driver (USB) 12年7月5日星期四
  • 3.
    About me • MFC Certificate • Linux driver • WDM driver (USB) • iOS App 12年7月5日星期四
  • 4.
    About me • MFC Certificate • Linux driver • WDM driver (USB) • iOS App 12年7月5日星期四
  • 5.
    About me • MFC Certificate • Linux driver • WDM driver (USB) • iOS App 12年7月5日星期四
  • 6.
    About me • MFC Certificate • Linux driver • WDM driver (USB) • iOS App Not interest any more 12年7月5日星期四
  • 7.
    Agenda • Development Environment • Objective-C • Cocoa • Design patterns • UX • References 12年7月5日星期四
  • 8.
    Agenda • Development Environment • Objective-C • Cocoa • Design patterns • UX • References 12年7月5日星期四
  • 9.
    Tested combinations XCode iOS ver OS X ver ver 5.1 4.3 10.7(Lion) • XCode 5.0 below 4.2 10.6.8(Leopard) Strictly depends on 12年7月5日星期四
  • 10.
  • 11.
    iOS Dev Center https://developer.apple.com/devcenter/ios/index.action 12年7月5日星期四
  • 12.
    Provision profile Your Mac Dev Center 12年7月5日星期四
  • 13.
    Demo • Create an empty App • Browse XCode features • organizer • project configurations • simulator • download • debug 12年7月5日星期四
  • 14.
    Agenda • Development Environment • Objective-C • Cocoa • Design patterns • UX • References 12年7月5日星期四
  • 15.
  • 16.
    Message passing [instance method]; 寫 iOS 最先看習慣的就是中括號 12年7月5日星期四
  • 17.
    Dynamism objective-C runtime library 12年7月5日星期四
  • 18.
    .h #import <Foundation/Foundation.h> @interface Fraction: NSObject { int numerator; int denominator; } -(void) print; -(void) setNumerator: (int) n; -(void) setDenominator: (int) d; @end 12年7月5日星期四
  • 19.
    .m #import "Fraction.h" @implementation Fraction -(void) print { NSLog(@"%i/%i", numerator, denominator); } -(void) setNumerator: (int) n { numerator = n; } -(void) setDenominator: (int) d { denominator = d; } @end 12年7月5日星期四
  • 20.
    Multiple arguments -(void) setTo: (int) n over: (int) d { numerator = n; denominator = d; } int main (int argc, char *argv[]) { Fraction *aFraction = [[Fraction alloc] init]; [aFraction setTo: 1 over: 3]; [aFraction print]; // -> 1/3 return 0; } 12年7月5日星期四
  • 21.
    Class method @interface Fraction: NSObject { int numerator; int denominator; } @interface FractionFactory: NSObject +(Fraction*) newFractionWithNumerator: (int)numerator andDenominator: (int)denominator; int main (int argc, char *argv[]) { Fraction* f = [FractionFactory newFractionWithNumerator: 1 andDenominator: 2]; } 12年7月5日星期四
  • 22.
    Synthesized accessor #import <Foundation/Foundation.h> @interface Fraction: NSObject { int numerator; } -(void) setNumerator: (int) n; // setter -(int) numerator; // getter @end compiler generates getter/setter @interface Fraction: NSObject @implementation Fraction @property numerator; @synthesis numerator; @end @end 12年7月5日星期四
  • 23.
    Dot accessing property [ instance setPoperty: 2]; is equal to instance.property = 2; 12年7月5日星期四
  • 24.
    self • self like this in C++ - (id)init { self = [super init]; if (self) { // Custom initialization } return self; } 12年7月5日星期四
  • 25.
    id • something like void* • useful at runtime 12年7月5日星期四
  • 26.
    selector • name of method , function literal • compile time SEL aSelector = @selector(methodName); • run time SEL aSelector = NSSelectorFromString(@"print"); NSString* selectorStr = NSStringFromSelector(aSelector); NSLog(@"%@", selectorStr); 12年7月5日星期四
  • 27.
    selector [friend performSelector:@selector(gossipAbout:) withObject:aNeighbor]; is equal to [friend gossipAbout:aNeighbor]; 12年7月5日星期四
  • 28.
    Runtime library 彈性:原本在 compile time, link time 要做的動 作,延到 run time 再做 12年7月5日星期四
  • 29.
    object A -(void)fly 完全沒有任何繼承關係 object B -(void)fly SEL userSelector = NSSelectorFromString(@”fly”); [ any performSelector: @selector(userSelector) ]; any 指向 object A, 就呼叫 A 的 fly any 指向 object B, 就呼叫 B 的 fly 12年7月5日星期四
  • 30.
    Category • extending class (even if you don’t have the source) #import "High.h" @interface High (calculate) - (NSInteger) plus:(NSInteger)operand1 and:(NSInteger)operand2; @end @implementation High (calculate) - (NSInteger) plus:(NSInteger)operand1 and:(NSInteger)operand2 { return operand1 + operand2; } @end 12年7月5日星期四
  • 31.
    Class extension • category without name • used as private method declaration in Obj- C 12年7月5日星期四
  • 32.
    Category may cause chaos • category wins over the override function • define same function in different categories. Lead to undefined condition. 12年7月5日星期四
  • 33.
    @protocol • class with only methods. • classes 之間說好要提供哪些 functions. @protocol MyXMLSupport - initFromXMLRepresentation:(NSXMLElement *)XMLElement; - (NSXMLElement *)XMLRepresentation; @end 12年7月5日星期四
  • 34.
    memory management • MRC - manual reference counting • ARC - automatic reference counting • garbage collection - in OS X, not in iOS 12年7月5日星期四
  • 35.
    MRC • Apple’s rule - owner release (owner: copy, alloc, retain) • burden on developers // retain release pair id value = [dict retain]; [value release]; // autorelease array = [[NSMutableArray new] autorelease]; 12年7月5日星期四
  • 36.
    ARC • supported on LLVM 3.0 • generate release code for you. 12年7月5日星期四
  • 37.
    Blocks this section is borrowed from WWDC 2011, sec. “block and central dispatch” * ^ 12年7月5日星期四
  • 38.
    Functions Blocks // body of code // body of code { { return a - b; return a - b; } } // pointer to a function // pointer to a block * ^ 12年7月5日星期四
  • 39.
    Functions Blocks // body of code // body of code { { return a - b; return a - b; } } // pointer to a function // pointer to a block int (*cmpr)(int, int); int (^cmpr)(int, int); 12年7月5日星期四
  • 40.
    Functions Blocks // body of code // body of code { { return a - b; return a - b; } } // pointer to a function // pointer to a block int (*cmpr)(int, int); int (^cmpr)(int, int); typedef int (*func_t) typedef int (^block_t) (int, int); (int, int); 12年7月5日星期四
  • 41.
    Functions Blocks // body of code // body of code { { return a - b; return a - b; } } // pointer to a function // pointer to a block int (*cmpr)(int, int); int (^cmpr)(int, int); typedef int (*func_t) typedef int (^block_t) (int, int); (int, int); func_t cmpr = arg; block_t cmpr = arg; 12年7月5日星期四
  • 42.
    Functions Blocks // body of code // body of code { { return a - b; return a - b; } } // pointer to a function // pointer to a block int (*cmpr)(int, int); int (^cmpr)(int, int); typedef int (*func_t) typedef int (^block_t) (int, int); (int, int); func_t cmpr = arg; block_t cmpr = arg; cmpr(x, y); cmpr(x, y); 12年7月5日星期四
  • 43.
    Functions Blocks // body of code // body of code { { return a - b; return a - b; } } // pointer to a function // pointer to a block * ^ 12年7月5日星期四
  • 44.
    Functions Blocks // body of code // body of code int my_cmp(int a, int b) ^(int a, int b) { { return a - b; return a - b; } } 12年7月5日星期四
  • 45.
    Functions Blocks // body of code // body of code int my_cmp(int a, int b) ^(int a, int b) { { return a - b; return a - b; } } // usage // usage sort(array, 10, my_cmp); sort(array, 10, ^(int a, int b) { return a - b; }); 12年7月5日星期四
  • 46.
    closure Blocks // body of code ^(int a, int b) { return a - b; } 12年7月5日星期四
  • 47.
    closure Blocks // body of code __block int cnt = 0; ^(int a, int b) { cnt++ ; return a - b; } log(“Count: %d”, cnt); 12年7月5日星期四
  • 48.
    Agenda • Development Environment • Objective-C • Cocoa • Design patterns • UX • References 12年7月5日星期四
  • 49.
    Cocoa fit iniOS 不管任何種類的 App,⼀一定會用到 UIKit 12年7月5日星期四
  • 50.
    UIKit Philosophy • MVC 12年7月5日星期四
  • 51.
  • 52.
  • 53.
    View Controllers Manage Views 12年7月5日星期四
  • 54.
    View Controllers Manage Views 12年7月5日星期四
  • 55.
    View Controllers Manage Views 12年7月5日星期四
  • 56.
  • 57.
    Important Documents View Controller Programming Guide for iOS View Programming Guide 12年7月5日星期四
  • 58.
    Agenda • Development Environment • Objective-C • Cocoa • Design patterns • UX • References 12年7月5日星期四
  • 59.
    delegate iOS UIApplication object MyApp delegate implemented via @protocol 12年7月5日星期四
  • 60.
    delegate iOS UIApplication object App 可以開始嗎? MyApp delegate implemented via @protocol 12年7月5日星期四
  • 61.
    delegate iOS UIApplication object App 可以開始嗎? MyApp delegate implemented via @protocol 12年7月5日星期四
  • 62.
    delegate iOS UIApplication object 可以 App 可以開始嗎? MyApp delegate implemented via @protocol 12年7月5日星期四
  • 63.
    delegate iOS UIApplication object MyApp delegate implemented via @protocol 12年7月5日星期四
  • 64.
    delegate iOS UIApplication object App 將要結束! MyApp delegate implemented via @protocol 12年7月5日星期四
  • 65.
    delegate iOS 不用回答,因為只 UIApplication object 是知會你的 App App 將要結束! MyApp delegate implemented via @protocol 12年7月5日星期四
  • 66.
    delegate iOS UIApplication object @protocol MyApp delegate implemented via @protocol 12年7月5日星期四
  • 67.
    delegate iOS UIApplication object some delegates are optional @protocol MyApp delegate implemented via @protocol 12年7月5日星期四
  • 68.
    delegate • no need to subclassing everywhere. • de-coupling decision, cleaner design. 12年7月5日星期四
  • 69.
    delegate demo https://github.com/tomjpsun/TestObjc.git 12年7月5日星期四
  • 70.
    Data-Source • nearly the same as delegate, 但是提供 data 而非 UI 決策. 有幾個 sections ? 4 TableView sec 1 cell 1 Controller “Clear History” 12年7月5日星期四
  • 71.
    Data-Source • nearly the same as delegate, 但是提供 data 而非 UI 決策. 有幾個 sections ? 4 TableView Data Source sec 1 cell 1 Controller “Clear History” 12年7月5日星期四
  • 72.
    Target-Action Button send message when the event occurs ViewController -(void)myButtonPressed: - (void)viewDidLoad { [super viewDidLoad]; ! [self.myButton addTarget:self action:@selector(myButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; } - (void)myButtonPressed:(UIButton*)button { ... } 12年7月5日星期四
  • 73.
    Notification observer 1 Notification anObject observer 2 Center post notification observer 3 broadcast notification reduce the code coupling 12年7月5日星期四
  • 74.
    Singleton request 1 request 1 response 1 Typical class response 1 A Singleton A response 2 request 2 response 2 B request 2 • 系統內,只能有⼀一份 instance,以某種標 準的 shared 方式共用之. 12年7月5日星期四
  • 75.
    Singleton • 是好的 design pattern ? 正反面討論很多 • Cocoa 很多用到 singleton pattern Notification UIApplication NSFileManager Center 12年7月5日星期四
  • 76.
    Agenda • Development Environment • Objective-C • Cocoa • Design patterns • UX • References 12年7月5日星期四
  • 77.
    abstract from the“Tap Worthy” book Get it done quick 你想要做的 12年7月5日星期四
  • 78.
    abstract from the“Tap Worthy” book Get it done quick 你想要做的 12年7月5日星期四
  • 79.
    abstract from the“Tap Worthy” book Get it done quick 你想要做的 使用者實際需要的 12年7月5日星期四
  • 80.
    abstract from the“Tap Worthy” book 依使用習慣分類 • 微任務化 • 找在地資訊 • 排遣無聊 12年7月5日星期四
  • 81.
    abstract from the“Tap Worthy” book 拇指習慣 左上和右上角,比較不容易按 12年7月5日星期四
  • 82.
    abstract from the“Tap Worthy” book 神奇的 44 手指可觸碰到的最小的限度 12年7月5日星期四
  • 83.
    Agenda • Development Environment • Objective-C • Cocoa • Design patterns • UX • References 12年7月5日星期四
  • 84.
    Agenda • Development Environment • Objective-C • Cocoa • Design patterns • UX • References 勸敗時間到了 ! 12年7月5日星期四
  • 85.
    Objective-C 入門 http://www.amazon.com/Programming-Objective-C-2-0-2nd-Edition/dp/0321566157 12年7月5日星期四
  • 86.
    Cocoa 入門 http://www.amazon.com/Cocoa-Design-Patterns-Erik-Buck/dp/0321535022/ref=sr_1_1? s=books&ie=UTF8&qid=1341483494&sr=1-1&keywords=cocoa+design+patterns 12年7月5日星期四
  • 87.
    Online Videos • CS193p in iTunes U(niversity) 12年7月5日星期四
  • 88.
    User Experience http://www.amazon.com/Tapworthy-Designing-Great-iPhone-Apps/dp/1449381650/ ref=sr_1_1?s=books&ie=UTF8&qid=1341483149&sr=1-1&keywords=tapworthy 12年7月5日星期四
  • 89.
    唯⼀一免費的 XCode documents 12年7月5日星期四
  • 90.
    唯⼀一免費的 XCode documents 免費的最硬 12年7月5日星期四
  • 91.