Top Banner

of 122

iOSApplicationProgrammingGuide

Jul 10, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

iOS

2011-06-22

Apple Inc. 2011 Apple Inc. All rights reserved. Apple Inc. 1 Apple Apple Inc. Apple Apple Inc. Apple Inc. Apple Apple Inc. 1 Infinite Loop Cupertino, CA 95014 U.S.A. 163-1450 3 20 2 http://www.apple.com/jp/ App Store is a service mark of Apple Inc. Apple, the Apple logo, AirPlay, Bonjour, Cocoa, Instruments, iPhone, iPod, iPod touch, iTunes, Keychain, Mac, Mac OS, Macintosh, Objective-C, Safari, and Xcode are trademarks of Apple Inc., registered in the United States and other countries. iPad and Retina are trademarks of Apple Inc. IOS is a trademark or registered trademark of Cisco in the U.S. and other countries and is used under license.

Intel and Intel Core are registered trademarks of Intel Corportation or its subsidiaries in the United States and other countries. OpenGL is a registered trademark of Silicon Graphics, Inc. UNIX is a registered trademark of The Open GroupApple Inc. Apple Inc. Apple Inc.

iOS 9iOS 10 10 10 11 App Store 11 11 12

1

13 13 13 14 14 14 15 15 15 16 17 17 18 19 19 19 20 iOS 20 20

2

25 25 26 29 main 30 31 32 40 40 41

32011-06-22 | 2011 Apple Inc. All Rights Reserved.

43 45 View Controller 45 46 48 49 50 51 3

53 53 54 AirPlay 54 55 55 57 57 59 61 63 URL 64 URL 64 URL 65 68 68

4

69 69 70 70 70 71 VoIP 72 75 76

5

79(Settings) 79 Settings 81 Settings Page 82 82 83 Settings 84

42011-06-22 | 2011 Apple Inc. All Rights Reserved.

Settings 84 Settings Page 84 Settings 85 Settings Page 89 89 90 90 6

91 91 93 iTunes 96 96 98 100 101 102 URL 103 103 Xcode 104 Info.plist 105 View Controller 105 106 107 107 1Xcode2 108 109

7

111 111 111 112 112 113 114 115 116 117 117 117 Wi-Fi 118 118

52011-06-22 | 2011 Apple Inc. All Rights Reserved.

121

62011-06-22 | 2011 Apple Inc. All Rights Reserved.

1

13 1-1 1-2 iOS 17 21

2

25 2-1 2-2 2-3 2-4 2-5 2-6 2-7 2-8 2-1 2-2 2-3 2-4 2-5 2-1 iOS 27 30 34 35 37 39 47 49 iOS 25 iOS 27 32 43 51 iOSmain 30

3

53 3-1 3-1 3-2 3-1 3-2 3-3Info.plistURL 65

56 CFBundleURLTypes 64 Documents 56 62 URL 66

4

69 4-1 4-1 4-2 4-3 VoIP 73 iOS 69 76 77

72011-06-22 | 2011 Apple Inc. All Rights Reserved.

5

79 5-1 5-2 5-3 5-1 5-2 5-3 5-1 Child Pane 83 Root.plist 85 Settings 86 80 Settings.bundle 81 Settings Page 82 89

6

91 6-1 6-2 6-3 6-1 6-2 6-3 6-4 6-5 94 (Info)(Properties) 95 (Language) 110 91 UIRequiredDeviceCapabilities 96 CFBundleIconFiles 99 101 101

7

111 7-1 7-2 113 114

82011-06-22 | 2011 Apple Inc. All Rights Reserved.

iOS

iOSiOS iOS

iOSiPadiPhoneiPod touch iOS

92011-06-22 | 2011 Apple Inc. All Rights Reserved.

iOS

iOSiOS SDKIntelMacintosh

iOSiOS iOS 13

UIKitiOS UIKit UIKit 25

iOS URL

10

iOS2011-06-22 | 2011 Apple Inc. All Rights Reserved.

iOS

53 79

69

App StoreInfo.plist App Store Info.plist 91

iOS iOS iOS

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

11

iOS

111

iOS

iOSCocoa Fundamentals Guide iOS iOS Human Interface Guidelines iOSiOS Technology Overview iOSYour First iOS Application

Event Handling Guide for iOS View Controller Programming Guide for iOS View Programming Guide for iOS Drawing and Printing Guide for iOS WebText,Web,andEditing Programming Guide for iOS Multimedia Programming Guide

12

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

1

iOS

iOSiPhoneiPad 1 iOS 4

iOSMac OS XMachBSD iOSUNIX iOSMac OS X

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

13

1

iOSMac OS X iOSMac OS X iOS iOS iOS 112

iOS1 68 115

iOS 4 40

14

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

1

iOS iOS

iOS / ApplicationRoot / ApplicationID /

ApplicationRoot ApplicationID 17 19

iOS 4 iPhone 3GSiPhone 4

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

15

1

58 58

57

iTunes iOS 4.0 iOS 4.0 kSecAttrAccessibleAlwaysThisDeviceOnly iOSKeychain Services Programming GuideKeychain Services Concepts

16

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

1

iOSLow-Level File Management Programming Topics

1-1 iTunes 15 1-1 iOS

/ AppName .app iOS 2.1iTunes App Store iTunes /Documents/ 19 iTunes

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

17

1

/Library/

55 iTunes Caches

/Library/Preferences NSUserDefaultsCFPreferences API 84 iTunes /Library/Caches

iTunes iOS 2.2iTunes

/tmp/

iOS 2.1iTunes

55 19

iOS

18

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

1

Document Interaction Controller 57

iTunes

iOS 2.2 iTunes

/ AppName .app /Library/Caches /tmp

iTunes App Store iTunes /Documents /tmp /Library/Caches

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

19

1

Application Home/Library/Caches/Documents Caches iPhone OS 2.2 1-1 17

iTunes

/Documents /Library

iOSiOSApp Store OpenGL ES iOSiOSDevelopmentGuideUsing iPhone Simulator

iOS GPS Info.plist UIRequiredDeviceCapabilities

20

iOS2011-06-22 | 2011 Apple Inc. All Rights Reserved.

1

Info.plist UIRequiredDeviceCapabilities 96 1-2 1-2

UIDevicemultitaskingSupported 69 iPad iPhone UIDeviceuserInterfaceIdiom

iPadiPhoneiPod touchUniversal 103

UIScreenscreens 1 View Programming Guide for iOSWindows UIApplicationprotectedDataAvailable 57

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

21

1

CFNetworkNSStream System Configuration System Configuration Reachability UIImagePickerControllerisSourceTypeAvailable: Camera Programming Topics for iOS UIImagePickerControllerisSourceTypeAvailable: availableMediaTypesForSourceType: UIImagePickerControllerSourceTypeCamera kUTTypeMovie Camera Programming Topics for iOS iOS 3AVAudioSession iOS AVAudioSession Class Reference GPS CLLocationManager Core Location Location Awareness Programming Guide External Accessory External Accessory Programming Topics

22

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

1

UIDevicebatteryLevel UIDevice Class Reference UIDeviceproximityState proximityMonitoringEnabled UIDevice Class Reference UIDevice UIApplication UIDevice Class ReferenceUIApplication Class Reference

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

23

1

24

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

2

iOSUIKit UIKit UIKit UIKit

UIKitMac OS XCocoa iOS 2-1 2-1 iOS

Model-View-Controller Model-View-ControllerMVC 1Model View ControllerModelView 1 iOS 4

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

25

2

1 Objective-C 1 retainrelease autorelease 0Objective-C iOS iOS 4Grand Central DispatchGCD . Concurrency Programming Guide

Cocoa Fundamentals Guide

UIKit iOS UIApplication UIKit 2-1iOS 2-2

26

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

2

2-1

iOSModel Data Model Objects Data Model Objects Data Model Objects

Controller UIApplication Application Delegate(custom object)

View UIWindow

Root View Controller Event Loop

Data Model Objects Data ModelController Additional Objects Objects (custom)

Data Model Objects Data Model Objects Views and UI Objects

Custom Objects System Objects Either system or custom objects

2-2

iOS UIApplication

UIApplication

nib UIApplication (Home) 31

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

27

2

View Controller View Controller UIViewControllerView Controller

UIKit View Controller View ContollerView Controller Programming Guide for iOSUIWindow UIWindow1

11 View Controller View Controller

UIKit UIView Core Animation

28

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

2

2-1 27 UIKit

iOS(Home) main UIKitUIKitnib 2-2iOS UIKit UIKit View Controller

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

29

2

2-2

UIKit User taps application icon Your code

main() application: didFinishLaunchingWithOptions:

UIApplicationMain()

Event Loop

Handle event

System asks application to quit foreground

applicationWillResignActive:

Application moves to background

applicationDidEnterBackground:

iOS 4

mainCiOS mainiOSmain UIKitXcode 2-1main 2-1 iOSmain

#import int main(int argc, char *argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; int retVal = UIApplicationMain(argc, argv, nil, nil); [pool release]; return retVal; }

30

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

2

Cocoa Memory Management Programming GuideiOS 113 mainUIApplicationMain4

argcargv

UIKit

3 nilUIKitUIApplication 4 nil nibXcode UIKit

UIApplicationMain

nibXcode nib UIKit Info.plistNSMainNibFilenib nib Info.plist 93

UIApplication UIKit

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

31

2

iOS 25 UIKitCocoa Fundamentals Guide iOS UIApplicationDelegate UIApplicationDelegateUIApplicationDelegate Protocol

Reference

iOS 4 2-31 iOS 3.2 2-3

SMS

69 iOS 4

32

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

2

iOS 4

application:didFinishLaunchingWithOptions: applicationDidBecomeActive: applicationWillResignActive: applicationDidEnterBackground: applicationWillEnterForeground: applicationWillTerminate:

application:didFinishLaunchingWithOptions: applicationDidBecomeActive:applicationDidEnterBackground: iOS 4.0 2-3 applicationDidBecomeActive: applicationDidEnterBackground:

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

33

2

2-3

Launch the application

Load main nib and create application delegate

Application Delegate

Initialize the application

application: didFinishLaunchingWithOptions:

Application enters the foreground

applicationDidBecomeActive:

application:didFinishLaunchingWithOptions:

application:didFinishLaunchingWithOptions: View Controller View Controller Programming Guide for iOSCustom View Controllers

application:didFinishLaunchingWithOptions:

5 application:didFinishLaunchingWithOptions:UIApplication applicationState UIApplicationStateInactive

UIApplicationStateBackground 2011-06-22 | 2011 Apple Inc. All Rights Reserved.

34

2

41

(Home) 2-4 applicationWillResignActive:applicationDidEnterBackground: applicationDidEnterBackground: 2-4

Application running

Application Delegate

User presses the Home button

applicationWillResignActive:

Application moves to the background

applicationDidEnterBackground:

Core Animation

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

35

2

applicationDidEnterBackground: 5 beginBackgroundTaskWithExpirationHandler: applicationDidEnterBackground:5 UIApplicationDidEnterBackgroundNotification applicationDidEnterBackground:2

applicationDidEnterBackground: applicationDidEnterBackground:

Bonjour 41 iOS 4.0 39

36

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

2

2-5 2-5 UIKit Application moves to the foreground Your code

Event Loop

A phone, SMS, or calendar notification arrives

applicationWillResignActive:

Ignore?No

Yes

applicationDidBecomeActive:

Application moves to the background

applicationDidEnterBackground:

1. 2.

SMS applicationWillResignActive: OpenGLOpenGL

3. 4.

applicationDidBecomeActive:

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

37

2

OpenGL 5. applicationDidEnterBackground: iOS 4.0 applicationDidEnterBackground: applicationWillTerminate: (Home) View Controller layoutSubviews /(Sleep/Wake) applicationWillResignActive: applicationDidBecomeActive: .

2-6applicationWillEnterForeground: applicationDidBecomeActive:

38

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

2

2-6

Application in the background

Application Delegate

Application is relaunched

applicationWillEnterForeground:

Application enters the foreground

applicationDidBecomeActive:

UIApplicationWillEnterForegroundNotification 1 View Controller 43

iOS 4.0. iOS 4.0 69 Info.plistUIApplicationExitsOnSuspend 45

applicationWillTerminate:

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

39

2

5 applicationWillTerminate: iOS SDK 4 UI applicationWillTerminate:

iOS 4 1

32 41 43 69

40

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

2

45

OpenGL ESEAGLContext OpenGL ES Bonjour Bonjour Bonjour (Address Book)

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

41

2

ExternalAccessory Programming Topics UIActionSheet UIAlertView iOS 4.0

applicationDidEnterBackground:

applicationWillTerminate:

42

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

2

1 1 View ControllerView ControllerUIKit 2-4 2-4

setNeedsDisplay setNeedsDisplayInRect: EAAccessoryDidConnectNotification EAAccessoryDidDisconnectNotification

UIDeviceOrientationDidChangeNotification

View Controller UIApplicationSignificantTimeChangeNotification

UIDeviceBatteryLevelDidChangeNotification UIDeviceBatteryStateDidChangeNotification UIDeviceProximityStateDidChangeNotification UIApplicationProtectedDataWillBecomeUnavailable UIApplicationProtectedDataDidBecomeAvailable

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

43

2

UIScreenDidConnectNotification UIScreenDidDisconnectNotification

UIScreenModeDidChangeNotification

NSUserDefaultsDidChangeNotification NSCurrentLocaleDidChangeNotification Instruments

NSCurrentLocaleDidChangeNotification

NSLocaleautoupdatingCurrentLocale

NSFormatter

(Settings) NSUserDefaultsDidChangeNotification NSUserDefaultsDidChangeNotification

44

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

2

Info.plistUIApplicationExitsOnSuspendYES (Home) applicationWillTerminate: 5 iOS SDK 4SDK Info.plistInformation Property List Key Reference

View Controller UIWindow1 iOS1 1 11UIView

View Controller2011-06-22 | 2011 Apple Inc. All Rights Reserved.

45

2

View ControllerUIViewController View ControllerView Controller View Controller View ControllerView Controller View Controller View Controller View ControllerView Controller iOS View ControllerView Controller Programming Guide for iOS View Programming Guide for iOS

iOS UIApplication UIApplication 2-7UIApplication

46

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

2

View Controller 2-7

Event source Port Event queue Main run loop Operating system

Application object

Core objects

1 UIApplication ThreadingProgrammingGuide UIEvent 1UITouch UIResponder UIApplicationUIViewControllerUIWindowUIView UIResponder UIWindow UIView View Controller

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

47

2

UIControl Event Handling Guide for iOS

iOS2

Core GraphicsUIKit OpenGL ES

iOS drawRect: setNeedsDisplaysetNeedsDisplayInRect: drawRect: OpenGL ES OpenGL iOSDrawing and Printing Guide foriOSOpenGL ES OpenGL ES Programming Guide for iOS

48

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

2

iOS 2-8 2-8

English

Russian

Korean

Japanese - Romanji

Japanese - Kana

Chinese - Handwriting

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

49

2

UILabelUITextFieldUITextView UIKitNSString Core GraphicsCore Text Core Text Text, Web, and Editing Programming Guide for iOS

iOS Media PlayerAV Foundation Core AudioOpenAL

iPod

iOSiOSTechnologyOverview iOSMultimedia Programming Guide

50

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

2

iOS 2-5 2-5 Address BookAddress Book UI Address Book Programming Guide for iOS Event KitEvent Kit UI (Calendar) Event Kit Programming Guide (Mail) SMS/MMS (Messages) SMSMessage UIView Controller System Messaging Programming Topics for iOS Core Telephony VoIPVoIP Core Telephony Framework Reference UIImagePickerController Camera Programming Topics for iOS

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

51

2

UIDocumentInteractionController Document Interaction Controller 59

1 Text, Web, and Editing Programming Guide for iOS

Core LocationLocation Awareness Programming Guide

Map Kit Map KitLocationAwarenessProgrammingGuide External Accessory External Accessory Programming Topics

iOS Technology Overview

52

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

3

iOS

View ControllerView Controller View Controller View Controller

View Controller View Controller View Controller

View ControllerView Controller View Controller

1View Controller View Controller1 View Controller Navigation ControllerTab Bar ControllerView ControllerView Controller View Controller nibView ControllerView Controller applicationDidEnterBackground:applicationWillTerminate: application:didFinishLaunchingWithOptions: View Controller

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

53

3

iOS View Controller

Info.plistUIInterfaceOrientation UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight View ControllershouldAutorotateToInterfaceOrientation: YESNO

View Controller View Controller View Controller OpenGL ES UIInterfaceOrientationView Controller

iOS iOS 2.1View Controller UIApplication setStatusBarOrientation:animated:applicationDidFinishLaunching: iOS v2.1View Controller 90

AirPlayAirPlay

APIAirPlay MPMoviePlayerControllerMPVolumeView AirPlay

54

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

3

(Media PlayerCore Audio family)AirPlay AirPlay MPMoviePlayerControllerallowsAirPlayYES

Info.plistUIBackgroundModesaudio AirPlay Playing Background Audio 71 Event Handling Guide for iOS Remote Control of Multimedia

iOS

NSSearchPathForDirectoriesInDomainsNSTemporaryDirectory Foundation 1 NSString NSSearchPathForDirectoriesInDomains

NSUserDomainMask 3-1

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

55

3

3-1

/Documents /Library/Caches /Library/ApplicationSupport

NSDocumentDirectory NSCachesDirectory NSApplicationSupportDirectory

/tmp NSSearchPathForDirectoriesInDomainsNSTemporaryDirectory NSSearchPathForDirectoriesInDomains1

Mac OS X1iOS 1 3-1 3-1 Documents

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0];

NSUserDomainMask 3-1 56 NSSearchPathForDirectoriesInDomains

NSApplicationDirectory NSSystemDomainMask/Applications 1NSSearchPathForDirectoriesInDomains iOS 3-1 56 (documentsDirectory)/var/mobile/Applications/30B51836-D2DD-43AA-BCB4-9D4DADFED6A2/Documents

iOS/Volumes/Stuff/Users/johnDoe/Library/Application Support/iOS Simulator/User/Applications/118086A0-FAAF-4CD4-9A0F-CD5E8D287270/Documents

NSUserDefaultsCFPreferences API Library/Preferences/ Settings 84 NSBundleCFBundleRef 2011-06-22 | 2011 Apple Inc. All Rights Reserved.

56

3

91

DocumentsiTunes 1. Info.plistUIFileSharingEnabled YES Documents

2.

iTunesApps File Sharing Documents iTunesDocuments Library LibraryLibrary Document Interaction ControllerDocument Interaction Controller 59

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

57

3

Foundation2

writeToFile:options:error:NSData NSDataWritingFileProtectionComplete NSFileManagersetAttributes:ofItemAtPath:error: NSFileProtectionKeyNSFileProtectionComplete

NSDatawriteToFile:options:error: 1 NSFileProtectionKeyNSData NSFileProtectionKey

UIKit

applicationProtectedDataWillBecomeUnavailable: applicationProtectedDataDidBecomeAvailable: UIApplicationProtectedDataWillBecomeUnavailable UIApplicationProtectedDataDidBecomeAvailable UIApplicationprotectedDataAvailable

applicationProtectedDataWillBecomeUnavailable:

58

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

3

applicationProtectedDataDidBecomeAvailable:

UIDocumentInteractionController Document Interaction Controller Document Interaction Controller 1. UIDocumentInteractionController Document Interaction ControllerGesture Recognizer Gesture Recognizer1

2. 3. 4.

Document Interaction Controller Document Interaction Controller Document Interaction Controller

Document Interaction ControllerDocument Interaction ControllerUIDocumentInteractionController Document Interaction Controller Document Interaction Controller - (UIDocumentInteractionController*)docControllerForFile:(NSURL*)fileURL { UIDocumentInteractionController* docController = [UIDocumentInteractionController interactionControllerWithURL:fileURL]; docController.delegate = self;

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

59

3

return docController; }

Document Interaction Controller Document Interaction Controller UIImageicons Document Interaction ControllerGesture RecognizergestureRecognizers Gesture Recognizer Gesture Recognizer UIImageView Document Interaction Controller annotation optionsUIApplicationLaunchOptionsAnnotationKeyannotation

Document Interaction ControllerGesture RecognizerUIDocumentInteractionController

presentOptionsMenuFromRect:inView:animated: presentOptionsMenuFromBarButtonItem:animated:

presentPreviewAnimated: presentOpenInMenuFromRect:inView:animated: presentOpenInMenuFromBarButtonItem:animated:

NO presentOpenInMenuFromRect:inView:animated: NO documentInteractionControllerViewControllerForPreview: View Controller Document Interaction Controller

60

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

3

nil View ControllerDocument Interaction Controller Document Interaction Controller dismissMenuAnimated:dismissPreviewAnimated:

Info.plist CFBundleDocumentTypes Document Interaction Controller CFBundleDocumentTypes1

11 1CFBundleDocumentTypes

CFBundleTypeName CFBundleTypeIconFiles

iOSHumanInterface Guidelines

LSItemContentTypesUTI types

LSHandlerRank

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

61

3

3-2Info.plistXML LSItemContentTypesUTI CFBundleTypeIconFiles 3-2

CFBundleTypeName My File Format CFBundleTypeIconFiles MySmallIcon.png MyLargeIcon.png LSItemContentTypes com.example.myformat LSHandlerRank Owner

CFBundleDocumentTypesInformation Property List Key Reference

application:didFinishLaunchingWithOptions: iOS 4.2application:openURL:sourceApplication:annotation: iOS 4.1application:handleOpenURL:

application:didFinishLaunchingWithOptions:

YES application:openURL:sourceApplication:annotation: application:handleOpenURL:application:didFinishLaunchingWithOptions:options

UIApplicationLaunchOptionsURLKeyNSURL

62

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

3

UIApplicationLaunchOptionsSourceApplicationKey NSString UIApplicationLaunchOptionsAnnotationKey

iOSiOS 4.2 application:openURL:sourceApplication:annotation: iOS 4.1 application:handleOpenURL:

Mail UIDocumentInteractionController ~/Documents/Inbox Inbox ~/Documents/Inbox Inbox Inbox Inbox

URL URL (Maps)URL (Maps)URL ApplehttpmailtotelsmsURL (Maps)YouTubeiPodhttp URL URLApple Apple

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

63

3

1URL URL NSURLUIApplicationopenURL: openURL:URL URL todolist NSURL *myURL = [NSURL URLWithString:@"todolist://www.acme.com?Quarterly%20Report#200806231300"]; [[UIApplication sharedApplication] openURL:myURL];

URLURL 64 URLURLApple URL Scheme Reference

URLURLURL URL URL (Maps) URL

URLURLInfo.plist CFBundleURLTypesCFBundleURLTypes URL 3-2 3-2 CFBundleURLName CFBundleURLTypes

URL com.acme.myschemeDNS InfoPlist.strings

64

URL2011-06-22 | 2011 Apple Inc. All Rights Reserved.

3

CFBundleURLSchemes URLhttpmailtotelsms

3-1to-doInfo.plist URL typesInfo.plistCFBundleURLTypes URL identifierURL Schemes CFBundleURLNameCFBundleURLSchemes 3-1Info.plistURL

URL 1. 2. (Home)SafariiOS (Hardware)(Home)(Home) SafariURL application:handleOpenURL:

3. 4.

URLURLURL URL URL

application:didFinishLaunchingWithOptions:URL

URL2011-06-22 | 2011 Apple Inc. All Rights Reserved.

65

3

iOS 4.2application:openURL:sourceApplication:annotation: iOS 4.1application:handleOpenURL:

URL URL application:didFinishLaunchingWithOptions:optionsURL YES application:openURL:sourceApplication:annotation: application:handleOpenURL:URL URL application:openURL:sourceApplication:annotation:URL iOS 4.1application:handleOpenURL: URLURL URL 103 URLNSURLURL NSURLRFC 1808URL RFC 1808 URL protocolURL 3-3application:handleOpenURL:URL to-do URL 3-3 URL

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { if ([[url scheme] isEqualToString:@"todolist"]) { ToDoItem *item = [[ToDoItem alloc] init]; NSString *taskName = [url query]; if (!taskName || ![self isValidTaskString:taskName]) { // [item release]; return NO; } taskName = [taskName stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; item.toDoTask = taskName;

66

URL2011-06-22 | 2011 Apple Inc. All Rights Reserved.

3

NSString *dateString = [url fragment]; if (!dateString || [dateString isEqualToString:@"today"]) { item.dateDue = [NSDate date]; } else { if (![self isValidDateString:dateString]) { [item release]; return NO; } // yyyymmddhhmm24 NSString *curStr = [dateString substringWithRange:NSMakeRange(0, 4)]; NSInteger yeardigit = [curStr integerValue]; curStr = [dateString substringWithRange:NSMakeRange(4, 2)]; NSInteger monthdigit = [curStr integerValue]; curStr = [dateString substringWithRange:NSMakeRange(6, 2)]; NSInteger daydigit = [curStr integerValue]; curStr = [dateString substringWithRange:NSMakeRange(8, 2)]; NSInteger hourdigit = [curStr integerValue]; curStr = [dateString substringWithRange:NSMakeRange(10, 2)]; NSInteger minutedigit = [curStr integerValue]; NSDateComponents *dateComps = [[NSDateComponents alloc] init]; [dateComps setYear:yeardigit]; [dateComps setMonth:monthdigit]; [dateComps setDay:daydigit]; [dateComps setHour:hourdigit]; [dateComps setMinute:minutedigit]; NSCalendar *calendar = [[[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar] autorelease]; NSDate *itemDate = [calendar dateFromComponents:dateComps]; if (!itemDate) { [dateComps release]; [item release]; return NO; } item.dateDue = itemDate; [dateComps release]; } [(NSMutableArray *)self.list addObject:item]; [item release]; return YES; } return NO; }

URLURL Secure Coding GuideValidating Input AppleURLApple URL Scheme Reference

URL2011-06-22 | 2011 Apple Inc. All Rights Reserved.

67

3

Settings

SettingsXcodeSettings (Settings) Settings Settings (Settings) 98 NSUserDefaultsAPICFPreferencesAPI Settings 79 User Defaults Programming Topics

iOS UIApplicationidleTimerDisabled YES NO

68

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

4

40 iOS SDK 4

iOS iOS 4 iOS 4 UIDevicemultitaskingSupported iOS 4 4-1 4-1 iOS

UIDevice* device = [UIDevice currentDevice]; BOOL backgroundSupported = NO; if ([device respondsToSelector:@selector(isMultitaskingSupported)]) backgroundSupported = device.multitaskingSupported;

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

69

4

Info.plistUIBackgroundModes1

audio -

AirPlay

location -

voip -

audio iOS2

70

70

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

4

iOS 4 iOS UIBackgroundModes Info.plistlocation Info.plist

iOS iOS4 Location Awareness Programming Guide

Info.plist audioUIBackgroundModes

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

71

4

AirPlay audio Info.plist AirPlay Media Player 1 1 Audio Session Programming Guide

VoIPVoIPVoice over Internet Protocol VoIP VoIP VoIP VoIP 1. Info.plistUIBackgroundModes voip 1VoIP setKeepAliveTimeout:handler:

2. 3.

72

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

4

4.

UIBackgroundModesvoip

VoIP VoIP audio voipUIBackgroundModes UIBackgroundModes Information Property List Key Reference

VoIPVoIP VoIP VoIP iOS VoIP VoIP 4-1 4-1 VoIP CocoasetProperty:forKey: NSStreamNetworkServiceType NSStreamNetworkServiceTypeVoIP URLNSMutableURLRequest setNetworkServiceType: NSURLNetworkServiceTypeVoIP

NSInputStream NSOutputStream

NSURLRequest

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

73

4

CFReadStreamRef CFWriteStreamRef

Core FoundationCFReadStreamSetProperty CFWriteStreamSetProperty kCFStreamNetworkServiceType kCFStreamNetworkServiceTypeVoIP

VoIP VoIP CocoaStreamProgrammingGuideforCocoa URLURL Loading System Programming GuideCFNetwork CFNetwork Programming Guide

VoIP iOSUIApplicationsetKeepAliveTimeout:handler: applicationDidEnterBackground: 1 3030 600

74

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

4

VoIP VoIP VoIPAudio Session Programming Guide

beginBackgroundTaskWithExpirationHandler: UIApplicationbackgroundTimeRemaining 2

beginBackgroundTaskWithExpirationHandler: endBackgroundTask: applicationDidEnterBackground: 1

beginBackgroundTaskWithExpirationHandler:endBackgroundTask: endBackgroundTask:

endBackgroundTask: backgroundTimeRemaining

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

75

4

beginBackgroundTaskWithExpirationHandler: endBackgroundTask: 4-2 applicationDidEnterBackground: bgTask 4-2

- (void)applicationDidEnterBackground:(UIApplication *)application { UIApplication* app = [UIApplication sharedApplication]; bgTask = [app beginBackgroundTaskWithExpirationHandler:^{ [app endBackgroundTask:bgTask]; bgTask = UIBackgroundTaskInvalid; }]; // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ // [app endBackgroundTask:bgTask]; bgTask = UIBackgroundTaskInvalid; }); }

UIKitUILocalNotification

76

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

4

UILocalNotification UIApplication UIApplication 4-31 1 128 application:didReceiveLocalNotification: 4-3

- (void)scheduleAlarmForDate:(NSDate*)theDate { UIApplication* app = [UIApplication sharedApplication]; NSArray* oldNotifications = [app scheduledLocalNotifications]; // if ([oldNotifications count] > 0) [app cancelAllLocalNotifications]; // UILocalNotification* alarm = [[[UILocalNotification alloc] init] autorelease]; if (alarm) { alarm.fireDate = theDate; alarm.timeZone = [NSTimeZone defaultTimeZone]; alarm.repeatInterval = 0; alarm.soundName = @"alarmsound.caf"; alarm.alertBody = @"Time to wake up!"; [app scheduleLocalNotification:alarm]; } }

PCM MA4u-Lawa-Law default UIApplication

UIApplication Class Reference Local and Push Notification Programming Guide

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

77

4

78

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

5

iOS Foundation 2

Settings(Settings)

Settings NSUserDefaults SettingsSettings (Settings) iOSHumanInterface Guidelines

(Settings)(Settings) (Setting) Settings 1 1 5-1 (Settings) Settings

(Settings)2011-06-22 | 2011 Apple Inc. All Rights Reserved.

79

5

5-1

Text field Text Field PSTextFieldSpecifier Title Title PSTitleValueSpecifier Toggle switch Toggle Switch(ON/OFF) PSToggleSwitchSpecifier Slider Slider PSSliderSpecifier Multivalue Multivalue1 PSMultiValueSpecifier Group Group1Group 1 PSGroupSpecifier Child Pane Child Pane 82 PSChildPaneSpecifier Settings Application Schema Reference Setting PageSettings 84

80

(Settings)2011-06-22 | 2011 Apple Inc. All Rights Reserved.

5

SettingsSettingsSettings.bundle Settings Page 1 5-2Settings 5-2 Root.plist Settings.bundle

Settings Page Root.plist Settings Page 82 Child Pane Settings Page

.plist

1.lproj Settings Page 1 Settings Page

Settings (Settings) 98 (Settings)Settings (Settings) (Settings)Settings Root.plist Settings Page Root.plist Settings Page(Settings) Settings Page .strings (Settings)

Settings2011-06-22 | 2011 Apple Inc. All Rights Reserved.

81

5

Settings PageSettings PageiPhone Settings Settings PageXcode Settings Page 84 XcodeProperty List Editor XcodeXML Settings Page 5-31 5-3 Settings Page 1 5-1 80 Settings Application Schema Reference

PreferenceSpecifiers

StringsTable

83

.plist .plist Root.plist Child Pane Child Pane1 Child PaneFile.plist Title (Settings) 5-1.plist

82

Settings2011-06-22 | 2011 Apple Inc. All Rights Reserved.

5

5-1

Child PaneSounds Group 1 New Voicemail New Email Sent Mail Group 2 Ringtones

Settings Group 1 Usage Group 2 Sounds Brightness Wallpaper Group 3 General Root.plist Root page

Sounds.plist

Sounds page General Group 1 Date & Time Network Keyboard

General.plist

General page

Child PaneSettings Application Schema Reference

Settings .strings(Settings) .strings .strings(Settings)

iOS Internationalization Programming Topics

Settings2011-06-22 | 2011 Apple Inc. All Rights Reserved.

83

5

SettingsXcodeSettings SettingsRoot.plist Settings

SettingsXcodeSettings 1. 2. 3. (File)(New File) iOSResourceSettings Bundle Settings.bundle

XcodeSettings Copy Bundle Resources Settings SettingsSettings.bundle/ Root.plist en.lproj/ Root.strings

Settings PageSettings BundleSettingsSettings Page SettingsRoot.plist Settings Page 1. SettingsRoot.plist a. (Groups & Files)Settings.bundle Root.plist

b. 2. 3.

Root.plistRoot (View)(Property List Type)iPhone Settings plist

84

Settings2011-06-22 | 2011 Apple Inc. All Rights Reserved.

5

Xcode 5-2 5-2

Root.plist

SettingsSettings 5-3 Settings Settings Page 84

Settings2011-06-22 | 2011 Apple Inc. All Rights Reserved.

85

5

5-3

Settings

1. 2.

Preference Items Item 0Sound

Preference ItemsItem 0 TitleGroupSound TypeGroup

3.

Sound1

Preference ItemsItem 2(Edit)

(Cut)

Item 0(Edit)(Paste)Text Field

ItemToggle Switch Item

Toggle Switch ItemTitlePlay Sounds Identifierplay_sounds_preference

86

Settings2011-06-22 | 2011 Apple Inc. All Rights Reserved.

5

4.

Sound2Toggle Switch

Item 1 (Play Sounds Toggle Switch)

(Edit)(Copy) (Edit)(Paste)Toggle Switch1Toggle Switch Toggle Switch ItemTitle3D Sound Identifier3D_sound_preference

1User Info 5.Item 3GroupUser Info

Preferences ItemsItem 3

Group

Settings2011-06-22 | 2011 Apple Inc. All Rights Reserved.

87

5

Item 3 TitleUser Info

6.

Name

Preferences ItemsItem 4

Text FieldTitleUser Info Identifieruser_name

7.

Experience Level

Item 4+Return

Multi Value TitleExperience LevelIdentifier experience_preferenceDefault Value0 Default ValueTitles Titles Titles

23 BeginnerExpertMaster Values 3Values012Item 5

8.

Settings

TypeGroupTitleGravity

88

Settings2011-06-22 | 2011 Apple Inc. All Rights Reserved.

5

1TypeSliderIdentifier gravity_preferenceDefault Value1Maximum Value2

Settings PageSettings BundleRoot.plist SettingsSettingsSettings XcodeSettings 1. (Groups & FilesSettingsRoot.plist (File)(New File) Mac OS X(Resource)Property List Root (View)(Property List Type)iPhone Settings plist

2. 3. 4. 5. 6.

SettingsSettingsSettings 85 82 Child Pane

iOSFoundationCore Foundation Foundation NSUserDefaultsCore Foundation 5-1 NSUserDefaultsSettings 85 5-1

- (void)applicationDidFinishLaunching:(UIApplication *)application { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [self setShouldPlaySounds:[defaults boolForKey:@"play_sounds_preference"]];

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

89

5

// }

NSUserDefaults NSUserDefaults Class Reference Core FoundationPreferences Utilities Reference

Settings (Settings)Settings (Settings) Settings NSUserDefaults registerDefaults: UserDefaults Programming TopicsUsing NSUserDefaults

iOS~/Library/Application Support/iOS Simulator/User/Applications//Library/Preferences

iOS Xcode iOS iOSReset Contents and Settings

90

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

6

iOS AppStore

iOSXcode 1 iOS 6-1iOS MyApp 6-1 MyApp

.app

Info.plist

93

MainWindow.nib

nib nib nib nib Info.plistNSMainNibFile 93

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

91

6

1 98 1 1 100 iTunesArtwork

512 x 512 App Store App Store iTunes App Store JPEGPNG

Settings.bundle (Settings)

68 sun.png

sun.png ISO 639-1.lproj fr.lproj en.lprojfr.lprojes.lproj es.lproj 109 en.lproj

iOSlanguage.lproj 2011-06-22 | 2011 Apple Inc. All Rights Reserved.

92

6

1. NSBundle

2. 3.

NSBundlemainBundle pathForResource:ofType: NSBundle1sun.png

1 2 UIImageNSString* imagePath = [[NSBundle mainBundle] pathForResource:@"sun" ofType:@"png"]; UIImage* sunImage = [[UIImage alloc] initWithContentsOfFile:imagePath];

Core FoundationCFBundleGetMainBundle CFBundleRefCore Foundation ResourceProgramming GuideiOSBundle Programming Guide

Info.plistXcodeiOS Info.plist(Groups & files)

Xcode 6-1 XcodeInfo.plist XcodeControl Show Raw Keys/Values

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

93

6

6-1

Xcode 6-2(Info) nib

94

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

6

6-2

(Info)(Properties)

XcodeInfo.plist iOS iOSInfo.plist

CFBundleIconFiles UIStatusBarStyle UIInterfaceOrientation UIRequiredDeviceCapabilities UIRequiresPersistentWiFi

Info.plist Information Property List Key Reference

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

95

6

iTunesApp Store App StoreWeb

Info.plist UIRequiredDeviceCapabilities iOS App Store UIRequiredDeviceCapabilitiesiOS 3.0

UIRequiredDeviceCapabilities 1true false false

6-2UIRequiredDeviceCapabilities 6-2 telephony UIRequiredDeviceCapabilities

(Phone) telURL SMS/MMS (Messages) sms URL UIImagePickerController

wifi

sms

still-camera

96

iTunes2011-06-22 | 2011 Apple Inc. All Rights Reserved.

6

auto-focus-camera

front-facing-camera UIImagePickerController

camera-flash

UIImagePickerController UIImagePickerController Core Motion Core Motion Core Location GPS gps GPSAGPS GPS location-services Wi-Fi GPS Core Location Game Center iOS 4.1

video-camera

accelerometer

gyroscope

location-services

gps

magnetometer

gamekit

iTunes2011-06-22 | 2011 Apple Inc. All Rights Reserved.

97

6

microphone

OpenGL ES 1.1 OpenGL ES 2.0 armv6 iOS 3.1 armv7 iOS 3.1 Bluetooth iOS 3.1

opengles-1

opengles-2

armv6

armv7

peer-peer

InformationPropertyListKeyReference

(Home)App Store Retina Info.plist CFBundleIconFiles PNG CFBundleIconFiles iOS 3.1.3 6-3CFBundleIconFilesRetina 2 2 2@2x Drawing and Printing Guide for iOS iOS Human Interface Guidelines

98

iTunes2011-06-22 | 2011 Apple Inc. All Rights Reserved.

6

6-3

CFBundleIconFiles

iPhone 57 x 57 114 x 114 @2x

iPhoneiPod touch @2xRetina iPad iPhoneiPod touch Settings @2xRetina iPad

iPad

72 x 72

iPhone/iPad 29 x 29 58 x 58 @2x

iPad

50 x 50

iPad

CFBundleIconFiles

CFBundleIconFilesCFBundleIconFile2 iOS 3.2 iPhoneiOS 3.1.3CFBundleIconFiles CFBundleIconFilesiOS 3.2 6-3 99 iOS 3.1.3

Icon.png - iPhoneiPod touch Icon-72.png - iPad Icon-Small.png - iPhoneiPod touch

Icon-Small-50.png - iPad

iTunes2011-06-22 | 2011 Apple Inc. All Rights Reserved.

99

6

iOS iOS 3.2CFBundleIconFilesInfo.plist iOS 3.2iOS 4 CFBundleIconFiles 512 x 512 iTunesArtwork iTunes iTunesArtwork App StoreJPEGPNG CFBundleIconFilesInformation Property List Key Reference

iOS Human Interface Guidelines

1 Default.png PNG .png DefaultInfo.plist UILaunchImageFile@2xRetina 6-4iOS iOS Human Interface Guidelines

100

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

6

6-4

iPhoneiPod touch 320 x 480 640 x 960 iPad 768 x 1004

1024 x 748

iOSInfo.plistUILaunchImageFile MyLaunchImage MyLaunchImage.png320 x 480 [email protected] [email protected] UILaunchImageFileInformation Property List Key Reference

iOS 3.2iPad .png 6-5> PNGiPad iPhoneiPod touch 6-5

-PortraitUpsideDown -Portrait

-LandscapeLeft

-Landscape -Landscape

-LandscapeRight

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

101

6

-Portrait

Default.png -PortraitUpsideDown -LandscapeLeft-LandscapeRight Default.png iOS 3.2 Default.png

-Landscape

UILaunchImageFileMyLaunchImageiPad MyLaunchImage-Landscape.png MyLaunchImage-Portrait.png Default-Landscape.pngDefault-Portrait.png application:didFinishLaunchingWithOptions: application:didFinishLaunchingWithOptions: View Controller View Controller View Controller Programming Guide for iOSCustom View Controllers

iPhoneiPad iPhone1 Default.pngiPad iOS 4.0

~ipad - iPad ~iphone - iPhoneiPod

102

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

6

iOS 3.2iOS 3.2 Default.pngDefault~iphone.png Default.pngiPad Default~iphone.pngiPhone Default@2x~iphone.png Info.plistUILaunchImageFile UILaunchImageFile~ipadiPad Info.plist Information Property List Key Reference

URL1URLURL1 URL URL - .png URL myschemeURL [email protected] Info.plistUILaunchImageFile Default URL -.png 101 109

iPhoneiPod touchiPad 1

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

103

6

iPadView ControlleriPhone iPod touch

XcodeXcode Window-Based Application Xcode iPad(Upgrade Current Target for iPad) 1. 2. 3. Xcode (Targets) (Project)iPad(Upgrade Current Target for iPad)1 XcodeiPhoneiPad

iPad(Upgrade Current Target for iPad) XcodeTargeted Device Family iPhone/PadBase SDK Xcodenib iPadnibInfo.plist nibXcodenib View ControlleriPadView Controller iPadiPhoneiPod touchiOS iOS 3.1 UISplitViewController 106

104

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

6

Info.plistiPhoneiPod touch Info.plist iPadInfo.plistUISupportedInterfaceOrientations iOS 3.2 iPadiPhoneiPhone OS 3.2 Info.plistInfo.plist key_root - ~ key_root platformiphoneosiOS iOS platform

iphone - iPhone ipod - iPod touch ipad - iPad

iPhoneiPod touch(portrait) iPad(landscape-right)Info.plist UIInterfaceOrientation UIInterfaceOrientationPortrait UIInterfaceOrientation~ipad UIInterfaceOrientationLandscapeRight

Info.plistInformation Property List Key

Reference

View Controller View Controller View ControllerView Controller

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

105

6

iPhone View Controller

View Controller

View ControllernibView Controller nib

drawRect: layoutSubviews

View ControllerView Controller Programming Guide for iOS

iOS iOS 4.2 SDKiOS 3.1

iOS SDK 4.2SDK if ([UIPrintInteractionController class]) { // } else { // Print Interaction Controller }

LLVMClang iOS 3.1

106

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

6

iOS SDK 4.1NSClassFromString nil Class splitVCClass = NSClassFromString(@"UISplitViewController"); if (splitVCClass) { UISplitViewController* mySplitViewController = [[splitVCClass alloc] init]; // Split View Controller }

instancesRespondToSelector: CNULL YESif (UIGraphicsBeginPDFPage != NULL) { UIGraphicsBeginPDFPage(); }

SDKCompatibilityGuide

UIDevice userInterfaceIdiom iPadiPhone iOS 3.2 UI_USER_INTERFACE_IDIOMif (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { // iOS 3.2iPad } else { // iPhoneiPod touch }

iPhoneDefault.png 101 iPad iPad

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

107

6

nibiPadnib iPad 98

107

1Xcode2 1XcodeiPhoneiPad Xcode (Project)iPad(Upgrade Current Target for iPad)iPhoneiPad 1. 2. 3. iPhoneXcode iPhone (Project)iPad(Upgrade Current Target for iPad)2

iPad(Upgrade Current Target for iPad) iPad(Upgrade Current Target for iPad) iPadiPadnib nibnibnib iPad nib nibView Controller iPad iPhone View Controller View Controller View Controller nibView Controller

108

1Xcode22011-06-22 | 2011 Apple Inc. All Rights Reserved.

6

View ControlleriPhoneiPad iPad iPad SDK Compatibility Guide

WebHTML nib

(Settings)(Language preferences) 6-3 (General)(International settings)

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

109

6

6-3

(Language)

ISO 639-1.lproj2 en.lproj lproj ISO 639-1ISO 639-2 lprojISO 3166-1 Internationalization Programming TopicsLanguage and Locale Designations lproj NSBundleCFBundleRef iOS Internationalization Programming Topics

110

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

7

iOS Mac OS X

Grand Central Dispatch (GCD) GCDConcurrency Programming Guide

iOS

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

111

7

iOS UIKit

applicationDidReceiveMemoryWarning:UIViewControllerdidReceiveMemoryWarning

UIApplicationDidReceiveMemoryWarningNotification

UIViewController UIApplicationDidReceiveMemoryWarningNotification iOSSimulate Memory Warning

7-1

112

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

7

7-1

iOS Instruments InstrumentsInstruments User Guide NSPropertyListSerialization PNGiOS pngcrush Core Data Core DataSQLite SQLite Core DataSQLite Core DataiOS 3.0 Thumb -mthumb35% ARMv6 Thumb ARMv7 Thumb

iOS 7-2

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

113

7

7-2

autorelease

autorelease release iOS mmap munmap File-System Performance Guidelines

iOS Cocoa Fundamentals GuideCocoa Objects

iOS ARMv6 -mthumbThumb ARMv7Thumb iOS 4Accelerate

114

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

7

iOS

CPU Wi-FiBluetooth(EDGE3G) Core Location

Instruments

CPU NSRunLoopNSTimer UIApplicationidleTimerDisabledNO CPU UIAccelerometer

Event Handling Guide for iOS

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

115

7

Wi-Fi Wi-Fi Wi-Fi Core Location Core Location GPSWi-FiCore LocationCore Location Location Awareness Programming Guide

Instruments Wi-FiBluetooth GPSCPU Instruments User Guide

iOS Mac OS XiOS Instruments Mac OS X CPU Instruments InstrumentsInstruments User Guide

116

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

7

Core Data SQLite

iOSiOS CFNetwork Core FoundationBSD FoundationNSStream Core OSBSD iOSCFNetwork CFNetwork Programming GuideCFNetwork Framework Reference NSStreamFoundation Framework Reference

1

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

117

7

Wi-Fi Bonjour Bonjour

Wi-FiWi-Fi Info.plistUIRequiresPersistentWiFi Wi-Fi Wi-Fi Wi-FiiOS30 UIRequiresPersistentWiFiWi-Fi iOS UIRequiresPersistentWiFitrue Wi-Fi Wi-FiUIRequiresPersistentWiFiInfo.plist

93

118

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

7

(Info.plist)UIRequiresPersistentWiFi true Wi-Fi

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

119

7

120

2011-06-22 | 2011 Apple Inc. All Rights Reserved.

iOS 2010-02-24 2010-12-13 2010-11-15 AirPlay iPad 2010-08-20 iPhone OS 2010-06-14 iOS 4 40 iPad 2010-02-24 2010-01-20 iPhoneInfo.plistInformation Property List Key Reference iOS 3.1 2009-06-17

2010-06-30

2009-10-19

1212011-06-22 | 2011 Apple Inc. All Rights Reserved.

OpenGLOpenGL ES Programming Guide for iOS Info.plist

2009-05-14

iOS 3.0

2009-01-06

(Settings) iTunes

2008-11-12

2008-10-15

iOSiOS Technology Overview URLApple URL Scheme Reference iOS Development Guide iPhone TextWeb Web iPhone OS Programming Guide

2008-07-08

iOSiPhone

1222011-06-22 | 2011 Apple Inc. All Rights Reserved.