[KJ-CODE] 스터디 소개, category

389 views

Published on

KJ-CODE 2014년 2월22일
KJ-CODE 소개 및 자기소개
Obj-C Category Programming

Published in: Technology
1 Comment
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total views
389
On SlideShare
0
From Embeds
0
Number of Embeds
21
Actions
Shares
0
Downloads
2
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

[KJ-CODE] 스터디 소개, category

  1. 1. Introduce KJ-CODE 2014.02.22 Ji SangHoon in KJ-CODE
  2. 2. KJ-CODE 2010.06.19 2010.10.16 2013.06.29 • Start from 2010. 6 • Start 9 Members • Study iOS Develop & IT Trend & IT Skills • We Still Study iOS with 15 Members • 6 Members are iOS Developer 2013.09.07
  3. 3. Who Am I Game Dev Embeded System Dev iOS DEV 2010 ~
  4. 4. Objective-C Category Programming 2014.02.22 Ji SangHoon in KJ-Code
  5. 5. Inherit • Vertical Inherit • Make new class • Can add new variable • Can access variable (expect @private) • Can add new method • Can use override method
  6. 6. Category • Horizon Inherit • Use original class • Can not add new variable (except static variable) • Can access variable (also @private) • Can add new method • Can not use override method
  7. 7. Inherit vs Category Inherit Category ○ × Add New Variable ○ △ (static variable) Access Variable △ (expect @private) ○ Add New Method ○ ○ Override Method ○ × Make New Class
  8. 8. Syntax Inherit @interface <Class Name> : UIViewController @interface OverlayViewController : UIViewController @interface MyTableViewController : UITableViewController Category @interface UIViewController (<Category Name>) @interface UIViewController (OverlayView)
  9. 9. How To Make New File… -> Objective-C Category File Name Input Category Name & Select Category On Class <Inherit Class Name> + <Category Name>.h / m
  10. 10. DEMO
  11. 11. Categories in Demo UIViewController+OverlayView UIColor+DefineColor UIImage+blur UIView+ScreenShot UILabel+AutoSize NSUserDefault+Addition You can download Sample Source Code in Github All KJ-CODE Sample Source https://github.com/dunkeyike/KJ-Code_ALL Category Sample Source https://github.com/dunkeyike/KJ-Code_ALL/tree/master/20140215_category
  12. 12. See Also.. Apple Developer Center - Customizing Existing Classes https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ ProgrammingWithObjectiveC/CustomizingExistingClasses/ CustomizingExistingClasses.html#//apple_ref/doc/uid/TP40011210-CH6-SW1 Objective-C:カテゴリで「できること」と「できないこと」 http://blog.livedoor.jp/kurokawh/archives/2469395.html Objective-Cの既存のクラスを拡張する仕組み http://labs.torques.jp/2011/01/14/1596/

×