SlideShare ist ein Scribd-Unternehmen logo
1 von 41
Objective-C


      2011 / 3 / 3

     Kenji Kinukawa
=> k.kinukawa, k_kinukawa
2010     11
    =>
2009
       => Trangram
Apple




Apple
=>Objective-C




                Objective-C
Objective-C
Objective-C
1983       , Stepstone
1985   NeXT Computer
1995   Next       Stepstone    Obj-C
1997   Apple Next             Jobs
       Mac OS X
2007   iPhone                    Obj-C

                                         -wikipedia
iOS                         Cocoa Touch

      iOS
                                                Cocoa
                UIKit                           Touch


            &

                                   Foundation

Core OS                 &
Objective-C
■

■C

■SmallTalk
■

■for, while, if, switch, C
■
■iOS             GC
           malloc free
■
■
    MyUtil.h
               @interface MyUtil{

               ...
               }

               ...
               @end

    MyUtil.m
               @implementation MyUtil

               ...
               @end
■
MyUtil.h


           @interface MyUtil{
            int hoge;

           }

           -(int)sumAB:(int)a adder:(int)b;
           -(int)diffAB:(int)a differ:(int)b;

           @end
■
MyUtil.m

           @implementation MyUtil
           -(int)sumAB:(int)a adder:(int)b
           {
           
 return a+b;
           }

           -(int)diffAB:(int)a differ:(int)b
           {
           
 return a-b;
           }
           @end
■


    -(double)evaluation:(int)val
    {
      hoge;
      huga;
      return buzz;
    }
■id
      id
 id




           id obj;
           [obj msg];
■




NSString * obj;
[obj hogehuga];

warning: 'NSString' may not respond to '-hogehuga'
                   NSString -hogehuga
■


         * hoge =
    [[     alloc] init];
■



    [obj msg];
SICP
(define (fact n)
 (if (= n 1)
   1
   (* (fact (- n 1)) n)))

(define (fact2 n)
 (define (in-fact n ans)
   (if (= n 1)
     ans
     (in-fact (- n 1) (* ans n))))
 (in-fact n 1))

(define (fact3 n)
 (define (fact2-iter n ans)
   (if (= n 0)
     ans
     (fact2-iter (- n 1) (* n ans))))
 (fact2-iter n 1))

(print (fact3 12000))
■




    [obj getHoge];
Obj-C
■

    ※



              -(double)evaluation:(int)val;


                      evaluation:
        -(double)evaluation:(int)val max:(int)a;


                  evaluation:max:
■SEL

SEL
SEL



             [obj callHoge];


  SEL action = @selector(callHoge);
  [obj performSelector:action];
■IMP

Obj-C                           C
                      IMP



IMP funcp = [foo methodForSelector:

             @selector(callHoge)];

xyz =
(*funcp)(foo, @selector(callHoge),nil,nil);
■


    Mac Objective-C2.0   GC



      [obj retain];
      [obj release];
■
    interface




 @protocol MGVoiceClientDelegate<NSObject>
 -(void)mgVoiceClient:(NSURLConnection *)conn   didReceiveResponseError:(NSString *)error;
 -(void)mgVoiceClient:(NSURLConnection *)conn   didFailWithError:(NSError*)error;
 -(void)mgVoiceClient:(NSURLConnection *)conn   didFinishGetting:(NSArray *)voices;
 -(void)mgVoiceClient:(NSURLConnection *)conn   didFinishPosting:(id)reply;
 @end


@interface VoiceTableViewController : UITableViewController <MGVoiceClientDelegate>{

 MGVoiceClient * voiceClient;

 NSArray * voiceArray;
}
■


 Not
             NSString+Parse.h

@interface NSString (Parse)
-(NSDictionary)parseJson:(NSString *)str;
-(NSDictionary)parseXml:(NSString *)str;
-(NSDictionary)parseYaml:(NSString *)str;
@end


[str parseJson:jsonStr];

                            NSString Parse
■
             NSString+Parse.h

@interface NSString (Parse)
-(NSDictionary)parseJson:(NSString *)str;
-(NSDictionary)parseXml:(NSString *)str;
-(NSDictionary)parseYaml:(NSString *)str;
@end


[str parseJson:jsonStr];

                   NSString Parse
■

Cocoa


                   A              B

        method A
                       method B
■


               A   B

    method A




    Obj-C
■


                A                        B

    method A                  method A

               delegate
                          B




    Obj-C
■
@protocol MGVoiceDelegate;

@interface MGVoice : NSObject{
@public

   id <MGVoiceDelegate> delegate;
}
@end

-(void)mgCommentClient:(NSURLConnection *)conn didFinishGetting:(NSArray *)commentArray{

   if([delegate respondsToSelector:@selector(mgVoice:didFinishGettingComments:)]){

   
       [delegate mgVoice:conn didFinishGettingComments:commentArray];

   }
}




- (void)viewDidLoad {
   [super viewDidLoad];

    voice.delegate = self;
}

-(void)mgVoice:(NSURLConnection *)conn didFinishGettingComments:(NSArray *)commentArray{

   if([commentArray count]>0){

   
      MGComment * comment = [commentArray objectAtIndex:0];

   
      commentText.text = comment.commentText;

   }else{

   
      commentText.text = @"                      ";

   }
}
■Blocks
Apple                         C                       ISO
LLVM                              iOS4.0
LLVM Compiler 2.0
LLVM
                                               LLVM      2.0
                                                       C Objective-C   C++




LLVM        GCC       2




Xcode 4                                LLVM   IDE
                                     LLVM
                  Xcode IDE                             C C++ Objective-C




                       block lambda
■Blocks
  void (^b)() = ^{
  
 
 printf("im in blockn");
  };
  b();
■Blocks
    void (^b)() = ^{
    
 
 printf("im in blockn");
    };
    b();

    C
Block
                   Block_copy(),Block_release()
iOS4    Blocks




ex)
  GCD(            )
■

    Objective-C
■
    mixi graph API
    mixi graph API       iPhone

                     ※

Weitere ähnliche Inhalte

Was ist angesagt?

What's New in C++ 11/14?
What's New in C++ 11/14?What's New in C++ 11/14?
What's New in C++ 11/14?Dina Goldshtein
 
Objective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchObjective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchMatteo Battaglio
 
JavaScript Design Patterns
JavaScript Design PatternsJavaScript Design Patterns
JavaScript Design PatternsDerek Brown
 
Lecture 3, c++(complete reference,herbet sheidt)chapter-13
Lecture 3, c++(complete reference,herbet sheidt)chapter-13Lecture 3, c++(complete reference,herbet sheidt)chapter-13
Lecture 3, c++(complete reference,herbet sheidt)chapter-13Abu Saleh
 
C++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorC++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorJussi Pohjolainen
 
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)jeffz
 
Advance features of C++
Advance features of C++Advance features of C++
Advance features of C++vidyamittal
 
Advance C++notes
Advance C++notesAdvance C++notes
Advance C++notesRajiv Gupta
 
Category theory, Monads, and Duality in the world of (BIG) Data
Category theory, Monads, and Duality in the world of (BIG) DataCategory theory, Monads, and Duality in the world of (BIG) Data
Category theory, Monads, and Duality in the world of (BIG) Datagreenwop
 
The Evolution of Async-Programming on .NET Platform (TUP, Full)
The Evolution of Async-Programming on .NET Platform (TUP, Full)The Evolution of Async-Programming on .NET Platform (TUP, Full)
The Evolution of Async-Programming on .NET Platform (TUP, Full)jeffz
 
Алексей Кутумов, Вектор с нуля
Алексей Кутумов, Вектор с нуляАлексей Кутумов, Вектор с нуля
Алексей Кутумов, Вектор с нуляSergey Platonov
 

Was ist angesagt? (20)

What's New in C++ 11/14?
What's New in C++ 11/14?What's New in C++ 11/14?
What's New in C++ 11/14?
 
C++ L01-Variables
C++ L01-VariablesC++ L01-Variables
C++ L01-Variables
 
Objective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchObjective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central Dispatch
 
Cpp tutorial
Cpp tutorialCpp tutorial
Cpp tutorial
 
JavaScript Design Patterns
JavaScript Design PatternsJavaScript Design Patterns
JavaScript Design Patterns
 
C++ L09-Classes Part2
C++ L09-Classes Part2C++ L09-Classes Part2
C++ L09-Classes Part2
 
Lecture 3, c++(complete reference,herbet sheidt)chapter-13
Lecture 3, c++(complete reference,herbet sheidt)chapter-13Lecture 3, c++(complete reference,herbet sheidt)chapter-13
Lecture 3, c++(complete reference,herbet sheidt)chapter-13
 
C++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorC++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operator
 
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
 
Smart Pointers
Smart PointersSmart Pointers
Smart Pointers
 
C++ L08-Classes Part1
C++ L08-Classes Part1C++ L08-Classes Part1
C++ L08-Classes Part1
 
JavaScript ES6
JavaScript ES6JavaScript ES6
JavaScript ES6
 
Advance features of C++
Advance features of C++Advance features of C++
Advance features of C++
 
Advance C++notes
Advance C++notesAdvance C++notes
Advance C++notes
 
C# 6.0 Preview
C# 6.0 PreviewC# 6.0 Preview
C# 6.0 Preview
 
Category theory, Monads, and Duality in the world of (BIG) Data
Category theory, Monads, and Duality in the world of (BIG) DataCategory theory, Monads, and Duality in the world of (BIG) Data
Category theory, Monads, and Duality in the world of (BIG) Data
 
The Evolution of Async-Programming on .NET Platform (TUP, Full)
The Evolution of Async-Programming on .NET Platform (TUP, Full)The Evolution of Async-Programming on .NET Platform (TUP, Full)
The Evolution of Async-Programming on .NET Platform (TUP, Full)
 
Bind me if you can
Bind me if you canBind me if you can
Bind me if you can
 
Алексей Кутумов, Вектор с нуля
Алексей Кутумов, Вектор с нуляАлексей Кутумов, Вектор с нуля
Алексей Кутумов, Вектор с нуля
 
C++ L11-Polymorphism
C++ L11-PolymorphismC++ L11-Polymorphism
C++ L11-Polymorphism
 

Andere mochten auch

20131209_buildinsidermeetup
20131209_buildinsidermeetup20131209_buildinsidermeetup
20131209_buildinsidermeetupkumake
 
サービスを成長させる為の開発について
サービスを成長させる為の開発についてサービスを成長させる為の開発について
サービスを成長させる為の開発についてtatsuya mazaki
 
いままで使ってきた携帯電話
いままで使ってきた携帯電話いままで使ってきた携帯電話
いままで使ってきた携帯電話Ippei Ogiwara
 
Hadoopの紹介
Hadoopの紹介Hadoopの紹介
Hadoopの紹介bigt23
 
2014.11.12 ibm bluemix pdf
2014.11.12 ibm bluemix pdf2014.11.12 ibm bluemix pdf
2014.11.12 ibm bluemix pdfYuichiro Maki
 
New Objective-C Features for Swift 2.0
New Objective-C Features for Swift 2.0New Objective-C Features for Swift 2.0
New Objective-C Features for Swift 2.0Goichi Hirakawa
 
CEDEC 2013 - 徹底的にチューンしたハイブリッドアプリ「D.O.T. Defender of Texel」の制作
CEDEC 2013 - 徹底的にチューンしたハイブリッドアプリ「D.O.T. Defender of Texel」の制作CEDEC 2013 - 徹底的にチューンしたハイブリッドアプリ「D.O.T. Defender of Texel」の制作
CEDEC 2013 - 徹底的にチューンしたハイブリッドアプリ「D.O.T. Defender of Texel」の制作Nobutaka Takushima
 
Cocos2d-xの深層〜Cocos2d-x組み込みによるピュアAndroid/iOSアプリの外科手術的統合
Cocos2d-xの深層〜Cocos2d-x組み込みによるピュアAndroid/iOSアプリの外科手術的統合Cocos2d-xの深層〜Cocos2d-x組み込みによるピュアAndroid/iOSアプリの外科手術的統合
Cocos2d-xの深層〜Cocos2d-x組み込みによるピュアAndroid/iOSアプリの外科手術的統合Ryuichi Kubuki
 
【登壇資料】人類総インターネット時代に20代を無駄にしないために
【登壇資料】人類総インターネット時代に20代を無駄にしないために【登壇資料】人類総インターネット時代に20代を無駄にしないために
【登壇資料】人類総インターネット時代に20代を無駄にしないためにJunichi Akagawa
 
Plannahプロジェクトの開発環境とdeploy gateの紹介
Plannahプロジェクトの開発環境とdeploy gateの紹介Plannahプロジェクトの開発環境とdeploy gateの紹介
Plannahプロジェクトの開発環境とdeploy gateの紹介Kenji Kinukawa
 
土下座パラダイスはこうして生まれた
土下座パラダイスはこうして生まれた土下座パラダイスはこうして生まれた
土下座パラダイスはこうして生まれたTakafumi Naito
 
革新的ブラウザゲームを支えるプラットフォーム技術
革新的ブラウザゲームを支えるプラットフォーム技術革新的ブラウザゲームを支えるプラットフォーム技術
革新的ブラウザゲームを支えるプラットフォーム技術Toru Yamaguchi
 
クックパッドでのVPC移行について
クックパッドでのVPC移行についてクックパッドでのVPC移行について
クックパッドでのVPC移行についてSugawara Genki
 
Aerospike deep dive migration
Aerospike deep dive migration Aerospike deep dive migration
Aerospike deep dive migration Makoto Uehara
 

Andere mochten auch (20)

20131209_buildinsidermeetup
20131209_buildinsidermeetup20131209_buildinsidermeetup
20131209_buildinsidermeetup
 
サービスを成長させる為の開発について
サービスを成長させる為の開発についてサービスを成長させる為の開発について
サービスを成長させる為の開発について
 
いままで使ってきた携帯電話
いままで使ってきた携帯電話いままで使ってきた携帯電話
いままで使ってきた携帯電話
 
Javaone報告会
Javaone報告会Javaone報告会
Javaone報告会
 
Hadoopの紹介
Hadoopの紹介Hadoopの紹介
Hadoopの紹介
 
2014.11.12 ibm bluemix pdf
2014.11.12 ibm bluemix pdf2014.11.12 ibm bluemix pdf
2014.11.12 ibm bluemix pdf
 
New Objective-C Features for Swift 2.0
New Objective-C Features for Swift 2.0New Objective-C Features for Swift 2.0
New Objective-C Features for Swift 2.0
 
CEDEC 2013 - 徹底的にチューンしたハイブリッドアプリ「D.O.T. Defender of Texel」の制作
CEDEC 2013 - 徹底的にチューンしたハイブリッドアプリ「D.O.T. Defender of Texel」の制作CEDEC 2013 - 徹底的にチューンしたハイブリッドアプリ「D.O.T. Defender of Texel」の制作
CEDEC 2013 - 徹底的にチューンしたハイブリッドアプリ「D.O.T. Defender of Texel」の制作
 
Cocos2d-xの深層〜Cocos2d-x組み込みによるピュアAndroid/iOSアプリの外科手術的統合
Cocos2d-xの深層〜Cocos2d-x組み込みによるピュアAndroid/iOSアプリの外科手術的統合Cocos2d-xの深層〜Cocos2d-x組み込みによるピュアAndroid/iOSアプリの外科手術的統合
Cocos2d-xの深層〜Cocos2d-x組み込みによるピュアAndroid/iOSアプリの外科手術的統合
 
【登壇資料】人類総インターネット時代に20代を無駄にしないために
【登壇資料】人類総インターネット時代に20代を無駄にしないために【登壇資料】人類総インターネット時代に20代を無駄にしないために
【登壇資料】人類総インターネット時代に20代を無駄にしないために
 
Cross2013_DeNA
Cross2013_DeNACross2013_DeNA
Cross2013_DeNA
 
PHP at Yahoo! JAPAN
PHP at Yahoo! JAPANPHP at Yahoo! JAPAN
PHP at Yahoo! JAPAN
 
Rfc768
Rfc768Rfc768
Rfc768
 
Plannahプロジェクトの開発環境とdeploy gateの紹介
Plannahプロジェクトの開発環境とdeploy gateの紹介Plannahプロジェクトの開発環境とdeploy gateの紹介
Plannahプロジェクトの開発環境とdeploy gateの紹介
 
PHPにおけるI/O多重化とyield
PHPにおけるI/O多重化とyieldPHPにおけるI/O多重化とyield
PHPにおけるI/O多重化とyield
 
Swift入門おさらい
Swift入門おさらいSwift入門おさらい
Swift入門おさらい
 
土下座パラダイスはこうして生まれた
土下座パラダイスはこうして生まれた土下座パラダイスはこうして生まれた
土下座パラダイスはこうして生まれた
 
革新的ブラウザゲームを支えるプラットフォーム技術
革新的ブラウザゲームを支えるプラットフォーム技術革新的ブラウザゲームを支えるプラットフォーム技術
革新的ブラウザゲームを支えるプラットフォーム技術
 
クックパッドでのVPC移行について
クックパッドでのVPC移行についてクックパッドでのVPC移行について
クックパッドでのVPC移行について
 
Aerospike deep dive migration
Aerospike deep dive migration Aerospike deep dive migration
Aerospike deep dive migration
 

Ähnlich wie Objective-Cひとめぐり

"О некоторых особенностях Objective-C++" Влад Михайленко (Maps.Me)
"О некоторых особенностях Objective-C++" Влад Михайленко (Maps.Me)"О некоторых особенностях Objective-C++" Влад Михайленко (Maps.Me)
"О некоторых особенностях Objective-C++" Влад Михайленко (Maps.Me)AvitoTech
 
Objective-C Runtime overview
Objective-C Runtime overviewObjective-C Runtime overview
Objective-C Runtime overviewFantageek
 
C++ amp on linux
C++ amp on linuxC++ amp on linux
C++ amp on linuxMiller Lee
 
Bytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreterBytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreterakaptur
 
Part II: LLVM Intermediate Representation
Part II: LLVM Intermediate RepresentationPart II: LLVM Intermediate Representation
Part II: LLVM Intermediate RepresentationWei-Ren Chen
 
掀起 Swift 的面紗
掀起 Swift 的面紗掀起 Swift 的面紗
掀起 Swift 的面紗Pofat Tseng
 
Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Value Objects, Full Throttle (to be updated for spring TC39 meetings)Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Value Objects, Full Throttle (to be updated for spring TC39 meetings)Brendan Eich
 
Mac ruby to the max - Brendan G. Lim
Mac ruby to the max - Brendan G. LimMac ruby to the max - Brendan G. Lim
Mac ruby to the max - Brendan G. LimThoughtWorks
 
MacRuby to The Max
MacRuby to The MaxMacRuby to The Max
MacRuby to The MaxBrendan Lim
 
iOS for Android Developers (with Swift)
iOS for Android Developers (with Swift)iOS for Android Developers (with Swift)
iOS for Android Developers (with Swift)David Truxall
 
PVS-Studio team experience: checking various open source projects, or mistake...
PVS-Studio team experience: checking various open source projects, or mistake...PVS-Studio team experience: checking various open source projects, or mistake...
PVS-Studio team experience: checking various open source projects, or mistake...Andrey Karpov
 
JIT compilation for CPython
JIT compilation for CPythonJIT compilation for CPython
JIT compilation for CPythondelimitry
 
Boyan Mihaylov - Is web assembly the killer of javascript
Boyan Mihaylov - Is web assembly the killer of javascriptBoyan Mihaylov - Is web assembly the killer of javascript
Boyan Mihaylov - Is web assembly the killer of javascriptCodemotion
 
Is WebAssembly the killer of JavaScript?
Is WebAssembly the killer of JavaScript?Is WebAssembly the killer of JavaScript?
Is WebAssembly the killer of JavaScript?Boyan Mihaylov
 

Ähnlich wie Objective-Cひとめぐり (20)

MacRuby, an introduction
MacRuby, an introductionMacRuby, an introduction
MacRuby, an introduction
 
Iphone course 2
Iphone course 2Iphone course 2
Iphone course 2
 
"О некоторых особенностях Objective-C++" Влад Михайленко (Maps.Me)
"О некоторых особенностях Objective-C++" Влад Михайленко (Maps.Me)"О некоторых особенностях Objective-C++" Влад Михайленко (Maps.Me)
"О некоторых особенностях Objective-C++" Влад Михайленко (Maps.Me)
 
C++ via C#
C++ via C#C++ via C#
C++ via C#
 
Boosting Developer Productivity with Clang
Boosting Developer Productivity with ClangBoosting Developer Productivity with Clang
Boosting Developer Productivity with Clang
 
Objective-C Runtime overview
Objective-C Runtime overviewObjective-C Runtime overview
Objective-C Runtime overview
 
C++ amp on linux
C++ amp on linuxC++ amp on linux
C++ amp on linux
 
Bytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreterBytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreter
 
Managing console
Managing consoleManaging console
Managing console
 
Why MacRuby Matters
Why MacRuby MattersWhy MacRuby Matters
Why MacRuby Matters
 
Part II: LLVM Intermediate Representation
Part II: LLVM Intermediate RepresentationPart II: LLVM Intermediate Representation
Part II: LLVM Intermediate Representation
 
掀起 Swift 的面紗
掀起 Swift 的面紗掀起 Swift 的面紗
掀起 Swift 的面紗
 
Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Value Objects, Full Throttle (to be updated for spring TC39 meetings)Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Value Objects, Full Throttle (to be updated for spring TC39 meetings)
 
Mac ruby to the max - Brendan G. Lim
Mac ruby to the max - Brendan G. LimMac ruby to the max - Brendan G. Lim
Mac ruby to the max - Brendan G. Lim
 
MacRuby to The Max
MacRuby to The MaxMacRuby to The Max
MacRuby to The Max
 
iOS for Android Developers (with Swift)
iOS for Android Developers (with Swift)iOS for Android Developers (with Swift)
iOS for Android Developers (with Swift)
 
PVS-Studio team experience: checking various open source projects, or mistake...
PVS-Studio team experience: checking various open source projects, or mistake...PVS-Studio team experience: checking various open source projects, or mistake...
PVS-Studio team experience: checking various open source projects, or mistake...
 
JIT compilation for CPython
JIT compilation for CPythonJIT compilation for CPython
JIT compilation for CPython
 
Boyan Mihaylov - Is web assembly the killer of javascript
Boyan Mihaylov - Is web assembly the killer of javascriptBoyan Mihaylov - Is web assembly the killer of javascript
Boyan Mihaylov - Is web assembly the killer of javascript
 
Is WebAssembly the killer of JavaScript?
Is WebAssembly the killer of JavaScript?Is WebAssembly the killer of JavaScript?
Is WebAssembly the killer of JavaScript?
 

Kürzlich hochgeladen

Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 

Kürzlich hochgeladen (20)

Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 

Objective-Cひとめぐり

  • 1. Objective-C 2011 / 3 / 3 Kenji Kinukawa
  • 2. => k.kinukawa, k_kinukawa 2010 11 => 2009 => Trangram
  • 3.
  • 4.
  • 6. =>Objective-C Objective-C
  • 9. 1983 , Stepstone 1985 NeXT Computer 1995 Next Stepstone Obj-C 1997 Apple Next Jobs Mac OS X 2007 iPhone Obj-C -wikipedia
  • 10. iOS Cocoa Touch iOS Cocoa UIKit Touch & Foundation Core OS &
  • 12. ■ ■for, while, if, switch, C ■ ■iOS GC malloc free
  • 13.
  • 14. MyUtil.h @interface MyUtil{ ... } ... @end MyUtil.m @implementation MyUtil ... @end
  • 15. ■ MyUtil.h @interface MyUtil{ int hoge; } -(int)sumAB:(int)a adder:(int)b; -(int)diffAB:(int)a differ:(int)b; @end
  • 16. ■ MyUtil.m @implementation MyUtil -(int)sumAB:(int)a adder:(int)b { return a+b; } -(int)diffAB:(int)a differ:(int)b { return a-b; } @end
  • 17. -(double)evaluation:(int)val { hoge; huga; return buzz; }
  • 18. ■id id id id obj; [obj msg];
  • 19. ■ NSString * obj; [obj hogehuga]; warning: 'NSString' may not respond to '-hogehuga' NSString -hogehuga
  • 20. * hoge = [[ alloc] init];
  • 21. [obj msg];
  • 22. SICP (define (fact n) (if (= n 1) 1 (* (fact (- n 1)) n))) (define (fact2 n) (define (in-fact n ans) (if (= n 1) ans (in-fact (- n 1) (* ans n)))) (in-fact n 1)) (define (fact3 n) (define (fact2-iter n ans) (if (= n 0) ans (fact2-iter (- n 1) (* n ans)))) (fact2-iter n 1)) (print (fact3 12000))
  • 23. [obj getHoge];
  • 24. Obj-C
  • 25. ※ -(double)evaluation:(int)val; evaluation: -(double)evaluation:(int)val max:(int)a; evaluation:max:
  • 26. ■SEL SEL SEL [obj callHoge]; SEL action = @selector(callHoge); [obj performSelector:action];
  • 27. ■IMP Obj-C C IMP IMP funcp = [foo methodForSelector: @selector(callHoge)]; xyz = (*funcp)(foo, @selector(callHoge),nil,nil);
  • 28. Mac Objective-C2.0 GC [obj retain]; [obj release];
  • 29. interface @protocol MGVoiceClientDelegate<NSObject> -(void)mgVoiceClient:(NSURLConnection *)conn didReceiveResponseError:(NSString *)error; -(void)mgVoiceClient:(NSURLConnection *)conn didFailWithError:(NSError*)error; -(void)mgVoiceClient:(NSURLConnection *)conn didFinishGetting:(NSArray *)voices; -(void)mgVoiceClient:(NSURLConnection *)conn didFinishPosting:(id)reply; @end @interface VoiceTableViewController : UITableViewController <MGVoiceClientDelegate>{ MGVoiceClient * voiceClient; NSArray * voiceArray; }
  • 30. ■ Not NSString+Parse.h @interface NSString (Parse) -(NSDictionary)parseJson:(NSString *)str; -(NSDictionary)parseXml:(NSString *)str; -(NSDictionary)parseYaml:(NSString *)str; @end [str parseJson:jsonStr]; NSString Parse
  • 31. NSString+Parse.h @interface NSString (Parse) -(NSDictionary)parseJson:(NSString *)str; -(NSDictionary)parseXml:(NSString *)str; -(NSDictionary)parseYaml:(NSString *)str; @end [str parseJson:jsonStr]; NSString Parse
  • 32. ■ Cocoa A B method A method B
  • 33. A B method A Obj-C
  • 34. A B method A method A delegate B Obj-C
  • 35. ■ @protocol MGVoiceDelegate; @interface MGVoice : NSObject{ @public id <MGVoiceDelegate> delegate; } @end -(void)mgCommentClient:(NSURLConnection *)conn didFinishGetting:(NSArray *)commentArray{ if([delegate respondsToSelector:@selector(mgVoice:didFinishGettingComments:)]){ [delegate mgVoice:conn didFinishGettingComments:commentArray]; } } - (void)viewDidLoad { [super viewDidLoad]; voice.delegate = self; } -(void)mgVoice:(NSURLConnection *)conn didFinishGettingComments:(NSArray *)commentArray{ if([commentArray count]>0){ MGComment * comment = [commentArray objectAtIndex:0]; commentText.text = comment.commentText; }else{ commentText.text = @" "; } }
  • 36. ■Blocks Apple C ISO LLVM iOS4.0 LLVM Compiler 2.0 LLVM LLVM 2.0 C Objective-C C++ LLVM GCC 2 Xcode 4 LLVM IDE LLVM Xcode IDE C C++ Objective-C block lambda
  • 37. ■Blocks void (^b)() = ^{ printf("im in blockn"); }; b();
  • 38. ■Blocks void (^b)() = ^{ printf("im in blockn"); }; b(); C Block Block_copy(),Block_release()
  • 39. iOS4 Blocks ex) GCD( )
  • 40. Objective-C
  • 41. mixi graph API mixi graph API iPhone ※

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n