iOS Development Seminar - PowerPoint PPT Presentation

1 / 61
About This Presentation
Title:

iOS Development Seminar

Description:

Title: iOS Development Seminar Last modified by: Document presentation format: Custom Other titles: Helvetica Light ProN W3 Arial ... – PowerPoint PPT presentation

Number of Views:175
Avg rating:3.0/5.0
Slides: 62
Provided by: ackr
Category:

less

Transcript and Presenter's Notes

Title: iOS Development Seminar


1
iOS Development Seminar
  • rodumani_at_sparcs.kaist.ac.kr
  • ? ??
  • 2013 06

2
iOS
  • Apple ? mobile OS
  • iPhoneOS3 -gt iOS4
  • iPhone, iPad, iPod touch
  • iOS61.3
  • Objective-C 2.0
  • Mac OS XCode4 ??
  • ?? AppStore? ??
  • ???? ?? ?? ??? ? ??

3
iOS Developer Program
  • iOS SDK? ??? ????
  • ??? App? Device Test, ??, APNS, iCloud, ????? ???
    ???? ?? ??? ??
  • ??? ???? ??? Simulator ?? ??
  • ????? 99, ????? 299 per year
  • http//developer.apple.com/ios

4
iOS Developer Library
  • iOS ? ???? ??? ? ?? ??.
  • http//developer.apple.com/library/ios

5
Objective-C 2.0
Tutorial Start Developing iOS Apps
Today https//developer.apple.com/library/ios/ref
erencelibrary/GettingStarted/RoadMapiOS/chapters/W
riteObjective-CCode/WriteObjective-CCode/WriteObje
ctive-CCode.html
6
Objective-C 2.0
  • C? ???? Smalltalk Style? ??? ??? ??? OOP??
  • Next ?? NeXTSTEP?? ????? ?? ??? Next? ???? Mac OS
    X? ??? ? NeXTSTEP? ??? ??? ??? ??? Cocoa
    Framework? ?? ??
  • Objective-C 2.0? ??? 1.0?? ??? ??

7
Objective-C 2.0
  • C??? ??? ?????? ???
  • JAVA? interface? ?? Protocol ??, ??????
  • Method ??? ??, Message ?? ??? ?? ??
  • MVC??
  • Garbage Collector ??(ARC,Auto Reference Count)?
    ???? iOS??? 5.0???? ????

8
????
  • .h Header file. class,type,function,constant
    declaration
  • .m Implementation file. Objective-C C code.
  • .mm Implementation file. Objective-C C Code.

9
??????
  • C? ?? ???
  • NSNumber, NSInteger, NSDouble...
  • NSString
  • NSDictionary,NSSet,NSArray,...
  • NSURL,NSURLRequest,NSURLResponse

10
??????
  • Objective-C??? String? _at_? ???
  • _at_asdfasdf
  • iOS 6.0 ???? ??? Syntax? ????.
  • _at_"42 //NSNumber numberWithInt42
  • _at__at_"a",_at_"b //NSArray arrayWithObjects_at_a,_at_b
    ,nil
  • _at__at_"key1"_at_"value1",_at_"key2"_at_"value2

11
??? ??(.h)
12
??? ??(.h)
_at_interface classname superclassname
ltProtocol1,Protocol2gt // ??? ??
classMethod1 // ??? ??? (return_type)classMetho
d2 (return_type)classMethod3(param1_type)param
1_varName - (return_type)instanceMethod1(param
1_type)param1_varName (param2_type)param2_varName
// ???? ??? - (return_type)instanceMethod2WithPa
rameter(param1_type)param1_varName
andOtherParameter(param2_type)param2_varName _at_en
d
13
??? ?? (.m)
import MyClass.h _at_implementation MyClass
(return_type)classMethod //
Implementation.. - (return_type)instanceMethod
// Implementation.. _at_end
14
???
  • Static typing
  • MyClass myObject1 // MyClass???? object? ??
  • Dynamic typing
  • id myObject2 // id???(void ???)? object? ??
  • id ? ??? ???? ?? Object? ??? ? ??.

15
??? ??
16
??? ??
  • Object methodmessage
  • NSString stringWithFormat_at_"_at_",_at_"rodumani"
  • webView loadRequestNSURLRequest
    allocinitWithURL
  • NSURL allocinitWithString_at_"http//m.naver.com"
  • NSURLRequest request1 webView request
  • NSURLRequest request2 webView.request

17
Property
  • In the general sense, property is some data
    encapsulated or stored by an object. It is
    either an attributesuch as a name or a coloror
    a relationship to one or more other objects.
  • Property? setPropertyName, propertyName? setter,
    getter? ?? ????, dot notation? ?? ??? ??.
  • Property?? getter, setter? ??? ?? Option? ? ? ??.
  • Accessor?? Cocoa,Cocoa Touch Framework?? KVC ??
    ?? ?? ??? ??? Element??.

18
Property Options
  • _at_property (nonatomic, copy) NSString userName
  • nonatomic / atomic
  • atomic? ????, Accessor Methods ? lock? ???? Multi
    Thread? ???? ????. ??? ???? ??? ?? ??? ?? ???
    nonatomic?? ??? ??? ?????. ???? atomic??.
  • assign / copy / retain
  • Value? Copy?? return??? ? ??? value? return ??.
    Retian? ?? ????? ? ??? Reference Count? ????.
    assign? setter? ?? ?? ??? ???? ??? ??.
  • readwrite / readonly
  • readonly? setter? ??.

19
Protocol
  • Protocol ??, Protocol? ???? Object? Protocol? ???
    ??? ???? ????, ? ???? ??? ??? ??? ???.
  • iOS ?? Delegate Pattern? ?? ?? ???? Pattern??
    Object? ??? ??? ?? ?, Delegate(???)?? ??? ??? ???
    ???.
  • ??? ???? ??? ?? ??? Protocol?? ????.
  • _at_interface HelloWorldViewController
    UIViewController ltUITextFieldDelegategt

Delegate Pattern http//en.wikipedia.org/wiki/Del
egation_pattern
20
Category
  • ?? ?? ???? ???? ??
  • ?? ???? ?? ??? ??? Method? ?? ? ??.

21
(No Transcript)
22
(No Transcript)
23
(No Transcript)
24
Start Developing iOS App Today
  • iOS ? ?? ??? ???? ???? ??? ??
  • http//developer.apple.com/library/ios/referencel
    ibrary/GettingStarted/RoadMapiOS/index.html23//ap
    ple_ref/doc/uid/TP40011343

25
iOS MVC Model
26
  • .h, .m ViewController ?? DataSource ? Source
    Code
  • .storyboard, .xib MVC???? V? ???? Layout?
    ???? ??. (android layout xml)
  • storyboard ? Action? ?? ??? ??? ??? ? ?? ???
    Layout ?? ????. (XCode 4.3 ??, iOS5 ????)

storyboard http//pinkyroman.tistory.com/4
27
? ????? ??? ??? ??
  • Mac OS X 10.8 Mountain Lion ??
  • Xcode 4.6.2
  • iOS 6.1.3
  • Deployment Target 6.0

28
Hello World!
  • Xcode? ??
  • Create a new Xcode project
  • ?? ?? ???? File-New-Project
  • iOS Application Single View Application
  • Product name helloworld
  • Organization name SPARCS
  • Company Identifier org.SPARCS.
  • Class Prefix Empty
  • Devices iPhone
  • Use Automatic Reference Counting
  • StoryBoard? ????

29
(No Transcript)
30
(No Transcript)
31
(No Transcript)
32
(No Transcript)
33
????!
34
(No Transcript)
35
(No Transcript)
36
(No Transcript)
37
(No Transcript)
38
(No Transcript)
39
(No Transcript)
40
iOS Simulator
  • A?? ??????? ???? ?? ??? ??? 11???? ??
  • Hardware-Device?? ???? ??? ?? ??
  • Hardware Lock(?L), Home(?- Shift H) ?? ????
    Lock? ??
  • ????? ???? ??
  • Option?? ??? ??? ??? ( ?? ??? ?? )
  • ?, iCloud, APNS ?? ???? ???? ??? ??? ??

41
?? ???
42
1. UI ??
43
(No Transcript)
44
(No Transcript)
45
View ? Code? ??
46
???
???? ??? ???
47
(No Transcript)
48
(No Transcript)
49
(No Transcript)
50
??? ???? ??? ??
  • import ltUIKit/UIKit.hgt
  • _at_interface ViewController UIViewController
  • _at_property (strong, nonatomic) IBOutlet
    UITextField lhsTextField
  • _at_property (strong, nonatomic) IBOutlet
    UITextField rhsTextField
  • _at_property (strong, nonatomic) IBOutlet UIButton
    calculateButton
  • _at_property (strong, nonatomic) IBOutlet UILabel
    resultLabel
  • -(IBAction)calculate(id)selector
  • _at_end

51
??? ???? ??? ??
52
??? ????
53
(No Transcript)
54
???
  • ???? ?????
  • ???? ???? ??? ???? ??

55
???
  • Calculate ??? ? ???? ???
  • ??? ??? ?? ???? ???
  • ???? ?????? ??

56
???? ??? ??
57
1. calculate? ??? ? ??? ???
58
2. ??? ??? ? ??? ???
59
3. Number Keyboard? ???
60
??!
61
????
  • ? ??? ??? ?????? ????
  • UITableView UINavigationController ????
  • HTTP NetworkRequest
  • JSON
  • ?? ??
Write a Comment
User Comments (0)
About PowerShow.com