Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Objective-Cひとめぐり

9,978 views

Published on

2011/3/3 mixi engineers seminar発表資料。

Published in: Technology
  • (Unlimited)....ACCESS WEBSITE Over for All Ebooks ................ accessibility Books Library allowing access to top content, including thousands of title from favorite author, plus the ability to read or download a huge selection of books for your pc or smartphone within minutes ......................................................................................................................... DOWNLOAD FULL PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full PDF EBOOK here { https://urlzs.com/UABbn }
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m77EgH } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m77EgH } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD FULL eBOOK INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. PDF eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc eBook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookeBOOK Crime, eeBOOK Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Objective-C Programming: The Big Nerd Ranch Guide (2nd Edition) (Big Nerd Ranch Guides) --- http://amzn.to/1R982Rx
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Objective C: Crash Course - The Ultimate Beginner's Course to Learning Objective C Programming in Under 12 Hours --- http://amzn.to/1T2JKuO
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Objective-Cひとめぐり

  1. 1. Objective-C 2011 / 3 / 3 Kenji Kinukawa
  2. 2. => k.kinukawa, k_kinukawa2010 11 =>2009 => Trangram
  3. 3. AppleApple
  4. 4. =>Objective-C Objective-C
  5. 5. Objective-C
  6. 6. Objective-C
  7. 7. 1983 , Stepstone1985 NeXT Computer1995 Next Stepstone Obj-C1997 Apple Next Jobs Mac OS X2007 iPhone Obj-C -wikipedia
  8. 8. iOS Cocoa Touch iOS Cocoa UIKit Touch & FoundationCore OS &
  9. 9. Objective-C■■C■SmallTalk
  10. 10. ■■for, while, if, switch, C■■iOS GC malloc free
  11. 11.
  12. 12. ■ MyUtil.h @interface MyUtil{ ... } ... @end MyUtil.m @implementation MyUtil ... @end
  13. 13. ■MyUtil.h @interface MyUtil{ int hoge; } -(int)sumAB:(int)a adder:(int)b; -(int)diffAB:(int)a differ:(int)b; @end
  14. 14. ■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
  15. 15. ■ -(double)evaluation:(int)val { hoge; huga; return buzz; }
  16. 16. ■id id id id obj; [obj msg];
  17. 17. ■NSString * obj;[obj hogehuga];warning: NSString may not respond to -hogehuga NSString -hogehuga
  18. 18. ■ * hoge = [[ alloc] init];
  19. 19. ■ [obj msg];
  20. 20. 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))
  21. 21. ■ [obj getHoge];
  22. 22. Obj-C
  23. 23. ■ ※ -(double)evaluation:(int)val; evaluation: -(double)evaluation:(int)val max:(int)a; evaluation:max:
  24. 24. ■SELSELSEL [obj callHoge]; SEL action = @selector(callHoge); [obj performSelector:action];
  25. 25. ■IMPObj-C C IMPIMP funcp = [foo methodForSelector: @selector(callHoge)];xyz =(*funcp)(foo, @selector(callHoge),nil,nil);
  26. 26. ■ Mac Objective-C2.0 GC [obj retain]; [obj release];
  27. 27. ■ 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;}
  28. 28. ■ 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
  29. 29. ■ NSString+Parse.h@interface NSString (Parse)-(NSDictionary)parseJson:(NSString *)str;-(NSDictionary)parseXml:(NSString *)str;-(NSDictionary)parseYaml:(NSString *)str;@end[str parseJson:jsonStr]; NSString Parse
  30. 30. ■Cocoa A B method A method B
  31. 31. ■ A B method A Obj-C
  32. 32. ■ A B method A method A delegate B Obj-C
  33. 33. ■@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 = @" "; }}
  34. 34. ■BlocksApple C ISOLLVM iOS4.0LLVM Compiler 2.0LLVM LLVM 2.0 C Objective-C C++LLVM GCC 2Xcode 4 LLVM IDE LLVM Xcode IDE C C++ Objective-C block lambda
  35. 35. ■Blocks void (^b)() = ^{ printf("im in blockn"); }; b();
  36. 36. ■Blocks void (^b)() = ^{ printf("im in blockn"); }; b(); CBlock Block_copy(),Block_release()
  37. 37. iOS4 Blocksex) GCD( )
  38. 38. ■ Objective-C
  39. 39. ■ mixi graph API mixi graph API iPhone ※

×