狠狠撸

狠狠撸Share a Scribd company logo
Objective-C 2.0
          GUI
 iPhone


12-B-1
(C)2009 T. Ogihara
?

?




?




    (C)2009 T. Ogihara
NeXTstep

           Objective-C
 ?




                    (C)2009 T. Ogihara
NeXTstep




           (C)2009 T. Ogihara
NeXTstep




           (C)2009 T. Ogihara
Objective-C
 ?C
              Smalltalk
                          ANSI C
 ?
              C++
 ?C



                                   (C)2009 T. Ogihara
Objective-C
 ? 1983     Brad Cox           Stepstone
 ? NeXT                (1988   )
 ? 1996     Apple      NeXT
 ? Mac OS X 2000
 ? Objective-C 2.0                 2007
 ? iPhone   2007

                                          (C)2009 T. Ogihara
C++     C
        C   C++         C++
?
    C




                  C
    C

                      (C)2009 T. Ogihara
Objective-C   C

      C       Objective-C
 ?


 ?




                    C
Objective-C


                            (C)2009 T. Ogihara
OO           (1)

?
?
             Mixin
?
? Java                 Objective-
    C
?

                            (C)2009 T. Ogihara
OO   (2)

? C++
    ::
?
?
? C#
?

               (C)2009 T. Ogihara
OO        (3)

?
     (int )
?




                    (C)2009 T. Ogihara
Objective-C 2.0

 ? Apple
     ?
     ?
     ?

                   1.0
 ?


 ?
                  (C)2009 T. Ogihara
(1)




   id   obj;   /*     */





   [ obj   msg ]
                            (C)2009 T. Ogihara
(2)




   [ obj   msg:100 ]

   [ obj   msg:100 param: N+1 ]





   r = [ obj msg:15 ];
                                   (C)2009 T. Ogihara
@interface        :
{
                      ;
        ...
}
              ;
  ...
@end

                          (C)2009 T. Ogihara
@implementation
- (id)initWithName:(NSString *)str
{
                 C
        ...
}
  ...
@end
              C
                               (C)2009 T. Ogihara
?


? virtual, final   C++,
    Java, C#
?


                    (C)2009 T. Ogihara
? Mac OS X


? Mac OS X 10.5 (Leopard)


? OS X iPhone


                            (C)2009 T. Ogihara
?


?
    @selector( )
?


                   (C)2009 T. Ogihara
[obj show];


[obj performSelector:@selector(show)];


SEL s = @selector(show);
[obj performSelector: s];

                                (C)2009 T. Ogihara
-

? Cocoa


?




? GUI         Cocoa

                      (C)2009 T. Ogihara
-

?


    ?
    ?



        show:

                (C)2009 T. Ogihara
? Objective-C




?
                NSObject

                           (C)2009 T. Ogihara
Carbon

         Cocoa

                 JDK




                               BSD
                       Quick
                       Time




         Mac OS X                    OS X iPhone
                                               (C)2009 T. Ogihara
?


    GUI
?


?


          (C)2009 T. Ogihara
(C)2009 T. Ogihara
(C)2009 T. Ogihara
iPhone

              -
 ?
 ? Foundation
 ? AppKit → UIKit
                    API   Core
 ?
     Foundation
                     C
 ?
                                 (C)2009 T. Ogihara

More Related Content

【12-B-1】 実例で学ぶ Objective-C 2.0 と GUI の関係~ iPhone アプリ開発を視野に入れて