没有合适的资源?快使用搜索试试~ 我知道了~
UIApplicationDelegate_Protocol
需积分: 9 0 下载量 64 浏览量
2013-08-27
14:43:54
上传
评论
收藏 272KB PDF 举报
温馨提示
试读
24页
The UIApplicationDelegate protocol declares methods that are implemented by the delegate of the singleton UIApplication object. These methods provide you with information about key events in an application’s execution such as when it finished launching, when it is about to be terminated, when memory is low, and when important changes occur. Implementing these methods gives you a chance to respond to these system events and respond appropriately.
资源推荐
资源详情
资源评论
UIApplicationDelegate Protocol Reference
Data Management: Event Handling
2011-10-12
Apple Inc.
© 2011 Apple Inc.
All rights reserved.
No part of this publication may be reproduced,
stored in a retrieval system, or transmitted, in
any form or by any means, mechanical,
electronic, photocopying, recording, or
otherwise, without prior written permission of
Apple Inc., with the following exceptions: Any
person is hereby authorized to store
documentation on a single computer for
personal use only and to print copies of
documentation for personal use provided that
the documentation contains Apple’s copyright
notice.
The Apple logo is a trademark of Apple Inc.
No licenses, express or implied, are granted
with respect to any of the technology described
in this document. Apple retains all intellectual
property rights associated with the technology
described in this document. This document is
intended to assist application developers to
develop applications only for Apple-labeled
computers.
Apple Inc.
1 Infinite Loop
Cupertino, CA 95014
408-996-1010
Apple, the Apple logo, and Objective-C are
trademarks of Apple Inc., registered in the
United States and other countries.
IOS is a trademark or registered trademark of
Cisco in the U.S. and other countries and is used
under license.
OpenGL is a registered trademark of Silicon
Graphics, Inc.
Even though Apple has reviewed this document,
APPLE MAKES NO WARRANTY ORREPRESENTATION,
EITHER EXPRESS OR IMPLIED, WITH RESPECT TO
THIS DOCUMENT, ITS QUALITY, ACCURACY,
MERCHANTABILITY, OR FITNESS FOR A PARTICULAR
PURPOSE. AS A RESULT, THIS DOCUMENT IS
PROVIDED “AS IS,” AND YOU, THE READER, ARE
ASSUMING THE ENTIRE RISK AS TO ITS QUALITY
AND ACCURACY.
IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT,
INDIRECT, SPECIAL, INCIDENTAL, OR
CONSEQUENTIAL DAMAGES RESULTING FROM ANY
DEFECT OR INACCURACY IN THIS DOCUMENT, even
if advised of the possibility of such damages.
THE WARRANTY AND REMEDIES SET FORTH ABOVE
ARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORAL
OR WRITTEN, EXPRESS OR IMPLIED. No Apple
dealer, agent, or employee is authorized to make
any modification, extension, or addition to this
warranty.
Some states do not allow the exclusion or limitation
of implied warranties or liability for incidental or
consequential damages, so the above limitation or
exclusion may not apply to you. This warranty gives
you specific legal rights, and you may also have
other rights which vary from state to state.
Contents
UIApplicationDelegate Protocol Reference 5
Overview 5
Tasks 6
Monitoring Application State Changes 6
Opening a URL Resource 6
Managing Status Bar Changes 6
Responding to System Notifications 7
Handling Remote Notifications 7
Handling Local Notifications 7
Responding to Content Protection Changes 7
Providing a Window for Storyboarding 8
Properties 8
window 8
Instance Methods 8
application:didChangeStatusBarFrame: 8
application:didChangeStatusBarOrientation: 9
application:didFailToRegisterForRemoteNotificationsWithError: 9
application:didFinishLaunchingWithOptions: 10
application:didReceiveLocalNotification: 11
application:didReceiveRemoteNotification: 12
application:didRegisterForRemoteNotificationsWithDeviceToken: 13
application:handleOpenURL: 14
application:openURL:sourceApplication:annotation: 15
application:willChangeStatusBarFrame: 16
application:willChangeStatusBarOrientation:duration: 16
applicationDidBecomeActive: 17
applicationDidEnterBackground: 17
applicationDidFinishLaunching: 18
applicationDidReceiveMemoryWarning: 19
applicationProtectedDataDidBecomeAvailable: 19
applicationProtectedDataWillBecomeUnavailable: 19
applicationSignificantTimeChange: 20
applicationWillEnterForeground: 20
applicationWillResignActive: 21
applicationWillTerminate: 21
Document Revision History 23
3
2011-10-12 | © 2011 Apple Inc. All Rights Reserved.
4
2011-10-12 | © 2011 Apple Inc. All Rights Reserved.
CONTENTS
Conforms to NSObject
Framework /System/Library/Frameworks/UIKit.framework
Availability Available in iOS 2.0 and later.
Declared in UIApplication.h
Companion guides iOS Application Programming Guide
Local and Push Notification Programming Guide
Related sample code AQOfflineRenderTest
International Mountains
KMLViewer
SpeakHere
TableViewSuite
Overview
The UIApplicationDelegate protocol declares methods that are implemented by the delegate of the
singleton UIApplication object. These methods provide you with information about key events in an
application’s execution such as when it finished launching, when it is about to be terminated, when memory
is low, and when important changes occur. Implementing these methods gives you a chance to respond to
these system events and respond appropriately.
One of the main jobs of the application delegate is to track the state transitions the application goes through
while it is running. Prior to iOS 4.0, applications were either active, inactive, or not running. In iOS 4.0 and
later, applications can also be running in the background or suspended. All of these transitions require a
response from your application to ensure that it is doing the right thing. For example, a background application
would need to stop updating its user interface. You provide the response to these transitions using the
methods of the application delegate.
Launch time is also a particularly important point in an application’s life cycle. In addition to the user launching
an application by tapping its icon, an application can be launched in order to respond to a specific type of
event. For example, it could be launched in response to an incoming push notification, it could be asked to
open a file, or it could be launched to handle some background event that it had requested. In all of these
cases, the options dictionary passed to the application:didFinishLaunchingWithOptions: (page
10) method provides information about the reason for the launch.
In situations where the application is already running, the methods of the application delegate are called in
response to key changes. Although the methods of this protocol are optional, most or all of them should be
implemented.
Overview 5
2011-10-12 | © 2011 Apple Inc. All Rights Reserved.
UIApplicationDelegate Protocol Reference
剩余23页未读,继续阅读
资源评论
gostfox
- 粉丝: 1
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功