iPhone OS Reference Library Apple Developer Connection spyglass button

UIApplication Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/UIKit.framework
Availability
Available in iPhone OS 2.0 and later.
Declared in
UIApplication.h
Related sample code

Overview

The UIApplication class provides a centralized point of control and coordination for applications running on iPhone OS.

Every application must have exactly one instance of UIApplication (or a subclass of UIApplication ). When an application is launched, the UIApplicationMain function is called; among its other tasks, this function create a singleton UIApplication object. Thereafter you can access this object by invoking the sharedApplication class method.

A major role of a UIApplication object is to handle the initial routing of incoming user events. It also dispatches action messages forwarded to it by control objects (UIControl) to the appropriate target objects. In addition, the UIApplication object maintains a list of all the windows (UIWindow objects) currently open in the application, so through those it can retrieve any of the application’s UIView objects. The application object is typically assigned a delegate, an object that the application informs of significant runtime events—for example, application launch, low-memory warnings, and application termination—giving it an opportunity to respond appropriately.

Applications can cooperatively handle a resource such as an email or an image file through the openURL: method. For example, an application opening an email URL with this method may cause the mail client to launch and display the message.

For iPhone OS 3.0, UIApplication has added methods for remote-notification registration, for triggering of the undo-redo UI (applicationSupportsShakeToEdit), and for determining whether any installed application can open a URL (canOpenURL:).

UIApplication defines a delegate that must adopt the UIApplicationDelegate protocol implement one or more of the methods.

The programmatic interfaces of UIApplication and UIApplicationDelegate also allow you to manage behavior that is specific to the device. You can control application response to changes in interface orientation, temporarily suspend incoming user events, and turn proximity sensing (of the user’s face) off and on again.

Subclassing Notes

You might decide to subclass UIApplication to override sendEvent: or sendAction:to:from:forEvent: to implement custom event and action dispatching. However, there is rarely a valid need to extend this class; the application delegate (UIApplicationDelegate is sufficient for most occasions. If you do subclass UIApplication, be very sure of what you are trying to accomplish with the subclass.

Tasks

Getting the Application Instance

Getting Application Windows

Controlling and Handling Events

Opening a URL Resource

Registering for Remote Notifications

Managing Application Activity

Managing Status Bar Orientation

Controlling Application Appearance

Setting and Getting the Delegate

Properties

For more about Objective-C properties, see “Properties” in The Objective-C Programming Language.

applicationIconBadgeNumber

The number currently set as the badge of the application icon in Springboard.

@property(nonatomic) NSInteger applicationIconBadgeNumber
Discussion

Set to 0 (zero) to hide the badge number. The default is 0.

Availability
Declared In
UIApplication.h

applicationSupportsShakeToEdit

A Boolean value that determines whether shaking the device displays the undo-redo user interface.

@property(nonatomic) BOOL applicationSupportsShakeToEdit
Discussion

The default value is YES. Set the property to NO if you don’t want your application to display the Undo and Redo buttons when users shake the device.

Availability
Related Sample Code
Declared In
UIApplication.h

delegate

The delegate of the application object.

@property(nonatomic, assign) id<UIApplicationDelegate> delegate
Discussion

The delegate must adopt the UIApplicationDelegate formal protocol. UIApplication assigns and does not retain the delegate.

Availability
Related Sample Code
Declared In
UIApplication.h

idleTimerDisabled

A Boolean value that controls whether the idle timer is disabled for the application.

@property(nonatomic, getter=isIdleTimerDisabled) BOOL idleTimerDisabled
Discussion

The default value of this property is NO. When most applications have no touches as user input for a short period, the system puts the device into a “sleep” state where the screen dims. This is done for the purposes of conserving power. However, applications that don't have user input except for the accelerometer—games, for instance—can, by setting this property to YES, disable the “idle timer” to avert system sleep.

Important: You should set this property only if necessary and should be sure to reset it to NO when the need no longer exists. Most applications should let the system turn off the screen when the idle timer elapses. This includes audio applications. With appropriate use of Audio Session Services, playback and recording proceed uninterrupted when the screen turns off. The only applications that should disable the idle timer are mapping applications, games, or similar programs with sporadic user interaction.

Availability
Related Sample Code
Declared In
UIApplication.h

keyWindow

The application’s key window. (read-only)

@property(nonatomic, readonly) UIWindow *keyWindow
Discussion

This property holds the UIWindow object in the windows array that is most recently sent the makeKeyAndVisible message.

Availability
See Also
Related Sample Code
Declared In
UIApplication.h

networkActivityIndicatorVisible

A Boolean value that turns an indicator of network activity on or off.

@property(nonatomic, getter=isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible
Discussion

Specify YES if the application should show network activity and NO if it should not. The default value is NO. A spinning indicator in the status bar shows network activity. The application may explicitly hide or show this indicator.

Availability
Related Sample Code
Declared In
UIApplication.h

proximitySensingEnabled

A Boolean value that determines whether proximity sensing is enabled. (Deprecated. The properties proximityMonitoringEnabled and proximityState of the UIDevice class are the replacements.)

@property(nonatomic, getter=isProximitySensingEnabled) BOOL proximitySensingEnabled
Discussion

YES if proximity sensing is enabled; otherwise NO. Enabling proximity sensing tells iPhone OS that it may need to blank the screen if the user’s face is near it. Proximity sensing is disabled by default.

Availability
Declared In
UIApplication.h

statusBarFrame

The frame rectangle defining the area of the status bar. (read-only)

@property(nonatomic, readonly) CGRect statusBarFrame
Discussion

The value of this property is CGRectZero if the status bar is hidden.

Availability
See Also
Declared In
UIApplication.h

statusBarHidden

A Boolean value that determines whether the status bar is hidden.

@property(nonatomic, getter=isStatusBarHidden) BOOL statusBarHidden
Return Value

YES means the status bar is hidden; NO means it’s visible.

Availability
See Also
Declared In
UIApplication.h

statusBarOrientation

The current orientation of the application’s status bar.

@property(nonatomic) UIInterfaceOrientation statusBarOrientation
Discussion

The value of this property is a constant that indicates an orientation of the receiver’s status bar. See UIInterfaceOrientation for details. Setting this property rotates the status bar to the specified orientation without animating the transition. If your application has rotatable window content, however, you should not arbitrarily set status-bar orientation using this method. The status-bar orientation set by this method does not change if the device changes orientation. For more on rotatable window view, see the UIWindow class reference.

Availability
See Also
Declared In
UIApplication.h

statusBarOrientationAnimationDuration

The animation duration in seconds for the status bar during a 90 degree orientation change. (read-only)

@property(nonatomic, readonly) NSTimeInterval statusBarOrientationAnimationDuration
Discussion

You should double the value of this property for a 180 degree orientation change in the status bar.

Availability
See Also
Declared In
UIApplication.h

statusBarStyle

The current style of the status bar.

@property(nonatomic) UIStatusBarStyle statusBarStyle
Discussion

The value of the property is a UIStatusBarStyle constant that indicates the style of status. The default style is UIStatusBarStyleDefault. The animation slides the status bar out for the old orientation and slides it in for the new orientation.

Availability
See Also
Related Sample Code
Declared In
UIApplication.h

windows

The application’s visible windows. (read-only)

@property(nonatomic, readonly) NSArray *windows
Discussion

This property is an array holding the application'€™s visible windows; the windows are ordered back to front.

Availability
See Also
Related Sample Code
Declared In
UIApplication.h

Class Methods

sharedApplication

Returns the singleton application instance.

+ (UIApplication *)sharedApplication

Return Value

The application instance is created in the UIApplicationMain function.

Availability
Related Sample Code
Declared In
UIApplication.h

Instance Methods

beginIgnoringInteractionEvents

Tells the receiver to suspend the handling of touch-related events.

- (void)beginIgnoringInteractionEvents

Discussion

You typically call this method before starting an animation or transition. Calls are nested with the endIgnoringInteractionEvents method.

Availability
  • Available in iPhone OS 2.0 and later.
See Also
Declared In
UIApplication.h

canOpenURL:

Returns whether an application can open a given URL resource.

- (BOOL)canOpenURL:(NSURL *)url

Parameters
url

A URL object that identifies a given resource. The URL’s scheme—possibly a custom scheme—identifies which application can handle the URL.

Return Value

NO if no application is available that will accept the URL; otherwise, returns YES.

Discussion

This method guarantees that that if openURL: is called, another application will be launched to handle it. It does not guarantee that the full URL is valid.

Availability
  • Available in iPhone OS 3.0 and later.
Declared In
UIApplication.h

enabledRemoteNotificationTypes

Returns the types of notifications the application accepts.

- (UIRemoteNotificationType)enabledRemoteNotificationTypes

Return Value

A bit mask whose values indicate the types of notifications the user has requested for the application. See UIRemoteNotificationType for valid bit-mask values.

Discussion

The values in the returned bit mask indicate the types of notifications currently enabled for the application. These types are first set when the application calls the registerForRemoteNotificationTypes: method to register itself with Apple Push Notification Service. Thereafter, the user may modify these accepted notification types in the Notifications preference of the Settings application. This method returns those initial or modified values. iPhone OS does not display or play notification types specified in the notification payload that are not one of the enabled types. For example, the application might accept icon-badging as a form of notification, but might reject sounds and alert messages, even if they are specified in the notification payload.

Availability
  • Available in iPhone OS 3.0 and later.
See Also
Declared In
UIApplication.h

endIgnoringInteractionEvents

Tells the receiver to resume the handling of touch-related events.

- (void)endIgnoringInteractionEvents

Discussion

You typically call this method when, after calling the beginIgnoringInteractionEvents method, the animation or transition concludes. Nested calls of this method should match nested calls of the beginIgnoringInteractionEvents method.

Availability
  • Available in iPhone OS 2.0 and later.
See Also
Declared In
UIApplication.h

isIgnoringInteractionEvents

Returns whether the receiver is ignoring events initiated by touches on the screen.

- (BOOL)isIgnoringInteractionEvents

Return Value

YES if the receiver is ignoring interaction events; otherwise NO. The method returns YES if the nested beginIgnoringInteractionEvents and endIgnoringInteractionEvents calls are at least one level deep.

Availability
  • Available in iPhone OS 2.0 and later.
Declared In
UIApplication.h

openURL:

Opens the resource at the specified URL.

- (BOOL)openURL:(NSURL *)url

Parameters
url

An object representing a URL (Universal Resource Locator). UIKit supports the http:, https:, tel:, and mailto: schemes.

Return Value

YES if the resource located by the URL was successfully opened; otherwise NO.

Discussion

The URL can locate a resource in the same or other application. If the resource is another application, invoking this method may cause the calling application to quit so the other one can be launched.

You may call canOpenURL: before calling this one to verify that there is an application that can handle it.

Availability
  • Available in iPhone OS 2.0 and later.
See Also
Related Sample Code
Declared In
UIApplication.h

registerForRemoteNotificationTypes:

Register to receive notifications of the specified types from a provider via Apple Push Service.

- (void)registerForRemoteNotificationTypes:(UIRemoteNotificationType)types

Parameters
types

A bit mask specifying the types of notifications the application accepts. See UIRemoteNotificationType for valid bit-mask values.

Discussion

When you send this message, the device initiates the registration process with Apple Push Service. If it succeeds, the application delegate receives a device token in the application:didRegisterForRemoteNotificationsWithDeviceToken: method; if registration doesn’t succeed, the delegate is informed via the application:didFailToRegisterForRemoteNotificationsWithError: method. If the application delegate receives a device token, it should connect with its provider and pass it the token.

iPhone OS does not display or play notification types specified in the notification payload that are not one of the requested ones. For example, if alert messages are not one of the accepted notification types, iPhone OS does not display an alert even if one is specified in the notification payload. To find out what the application’s current notification types are, call the enabledRemoteNotificationTypes method.

Availability
  • Available in iPhone OS 3.0 and later.
See Also
Declared In
UIApplication.h

sendAction:to:from:forEvent:

Sends an action message identified by selector to a specified target.

- (BOOL)sendAction:(SEL)action to:(id)target from:(id)sender forEvent:(UIEvent *)event

Parameters
action

A selector identifying an action method. See the discussion for information on the permitted selector forms.

target

The object to receive the action message. If target is nil, the application sends the message to the first responder, from whence it progresses up the responder chain until it is handled.

sender

The object that is sending the action message. The default sender is the UIControl object that invokes this method.

event

A UIEvent object that encapsulates information about the event originating the action message.

Return Value

YES if a responder object handled the action message, NO if no object in the responder chain handled the message.

Discussion

Normally, this method is invoked by a UIControl object that the user has touched. The default implementation dispatches the action method to the given target object or, if no target is specified, to the first responder. Subclasses may override this method to perform special dispatching of action messages.

By default, this method pushes two parameters when calling the target. These last two parameters are optional for the receiver because it is up to the caller (usually a UIControl object) to remove any parameters it added. This design enables the action selector to be one of the following:

Availability
  • Available in iPhone OS 2.0 and later.
See Also
Declared In
UIApplication.h

sendEvent:

Dispatches an event to the appropriate responder objects in the application.

- (void)sendEvent:(UIEvent *)event

Parameters
event

A UIEvent object encapsulating the information about an event, including the touches involved.

Discussion

Subclasses may override this method to intercept incoming events for inspection and special dispatching. iPhone OS calls this method for public events only.

Availability
  • Available in iPhone OS 2.0 and later.
See Also
Declared In
UIApplication.h

setStatusBarHidden:animated:

Hides or shows the status bar, optionally animating the transition.

- (void)setStatusBarHidden:(BOOL)hidden animated:(BOOL)animated

Parameters
hidden

YES if the status bar should be hidden, NO if it should be visible. The default value is NO.

animated

YES if the transition to or from a hidden state should be animated, NO otherwise.

Discussion

The animation fades the status bar out or in at the top of the interface, depending on the value of hidden.

Availability
  • Available in iPhone OS 2.0 and later.
See Also
Related Sample Code
Declared In
UIApplication.h

setStatusBarOrientation:animated:

Sets the application’s status bar to the specified orientation, optionally animating the transition.

- (void)setStatusBarOrientation:(UIInterfaceOrientation)interfaceOrientation animated:(BOOL)animated

Parameters
interfaceOrientation

A specific orientation of the status bar. See UIInterfaceOrientation for details. The default value is UIInterfaceOrientationPortrait.

animated

YES if the transition to the new orientation should be animated; NO if it should be immediate, without animation.

Discussion

Calling this method changes the value of the statusBarOrientation property and rotates the status bar, animating the transition if animated is YES . If your application has rotatable window content, however, you should not arbitrarily set status-bar orientation using this method. The status-bar orientation set by this method does not change if the device changes orientation.

Availability
  • Available in iPhone OS 2.0 and later.
See Also
Declared In
UIApplication.h

setStatusBarStyle:animated:

Sets the style of the status bar, optionally animating the transition to the new style

- (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle animated:(BOOL)animated

Parameters
statusBarStyle

A constant that specifies a style for the status bar. See the descriptions of the constants in UIStatusBarStyle for details.

animated

YES if the transition to the new style should be animated; otherwise NO .

Discussion

The animation slides the status bar out toward the top of the interface.

Availability
  • Available in iPhone OS 2.0 and later.
See Also
Related Sample Code
Declared In
UIApplication.h

unregisterForRemoteNotifications

Unregister for notifications received from Apple Push Service.

- (void)unregisterForRemoteNotifications

Discussion

You should call this method in rare circumstances only, such as when a new version of the application drops support for remote notifications. Users can temporarily prevent applications from receiving remote notifications through the Notifications section of the Settings application. Applications unregistered through this method can always re-register.

Availability
  • Available in iPhone OS 3.0 and later.
See Also
Declared In
UIApplication.h

Constants

UIInterfaceOrientation

The orientation of the application's user interface.

typedef enum {
   UIInterfaceOrientationPortrait           = UIDeviceOrientationPortrait,
   UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown,
   UIInterfaceOrientationLandscapeLeft      = UIDeviceOrientationLandscapeRight,
   UIInterfaceOrientationLandscapeRight     = UIDeviceOrientationLandscapeLeft
} UIInterfaceOrientation;
Constants
UIInterfaceOrientationPortrait

The device is in portrait mode, with the device held upright and the home button on the bottom.

Available in iPhone OS 2.0 and later.

Declared in UIApplication.h.

UIInterfaceOrientationPortraitUpsideDown

The device is in portrait mode but upside down, with the device held upright and the home button at the top.

Available in iPhone OS 2.0 and later.

Declared in UIApplication.h.

UIInterfaceOrientationLandscapeLeft

The device is in landscape mode, with the device held upright and the home button on the left side.

Available in iPhone OS 2.0 and later.

Declared in UIApplication.h.

UIInterfaceOrientationLandscapeRight

The device is in landscape mode, with the device held upright and the home button on the right side.

Available in iPhone OS 2.0 and later.

Declared in UIApplication.h.

Discussion

You use these constants in the statusBarOrientation property and the setStatusBarOrientation:animated: method. Notice that UIDeviceOrientationLandscapeRight is assigned to UIInterfaceOrientationLandscapeLeft and UIDeviceOrientationLandscapeLeft is assigned to UIInterfaceOrientationLandscapeRight; the reason for this is that rotating the device requires rotating the content in the opposite direction.

Availability
  • Available in iPhone OS 2.0 and later.
Declared In
UIApplication.h

UIStatusBarStyle

The style of the device’€™s status bar.

typedef enum {
   UIStatusBarStyleDefault,
   UIStatusBarStyleBlackTranslucent,
   UIStatusBarStyleBlackOpaque
} UIStatusBarStyle;
Constants
UIStatusBarStyleDefault

A gray style (the default).

Available in iPhone OS 2.0 and later.

Declared in UIApplication.h.

UIStatusBarStyleBlackTranslucent

A transparent black style (specifically, black with an alpha of 0.5).

Available in iPhone OS 2.0 and later.

Declared in UIApplication.h.

UIStatusBarStyleBlackOpaque

An opaque black style.

Available in iPhone OS 2.0 and later.

Declared in UIApplication.h.

Availability
  • Available in iPhone OS 2.0 and later.
Declared In
UIApplication.h

Run Loop Mode for Tracking

Mode while tracking in controls is taking place.

UIKIT_EXTERN NSString *UITrackingRunLoopMode;
Constants
UITrackingRunLoopMode

The mode set while tracking in controls takes place. You can use this mode to add timers that fire during tracking.

Available in iPhone OS 2.0 and later.

Declared in UIApplication.h.

Declared In
UIApplication.h

UserInfo Dictionary Keys

Keys used to access values in the userInfo dictionary of some UIApplication-posted notifications and in the dictionary passed into application:didFinishLaunchingWithOptions: method declared in the UIApplicationDelegate protocol.

UIKIT_EXTERN NSString *const UIApplicationStatusBarOrientationUserInfoKey;
UIKIT_EXTERN NSString *const UIApplicationWillChangeStatusBarFrameNotification;
UIKIT_EXTERN NSString *const UIApplicationDidChangeStatusBarFrameNotification;
UIKIT_EXTERN NSString *const UIApplicationStatusBarFrameUserInfoKey;
UIKIT_EXTERN NSString *const UIApplicationLaunchOptionsURLKey;
UIKIT_EXTERN NSString *const UIApplicationLaunchOptionsSourceApplicationKey;
UIKIT_EXTERN NSString *const UIApplicationLaunchOptionsRemoteNotificationKey;
Constants
UIApplicationStatusBarOrientationUserInfoKey

Accesses an NSNumber object that encapsulates a UIInterfaceOrientation value indicating the current orientation (see UIInterfaceOrientation). This key is used with UIApplicationDidChangeStatusBarOrientationNotification and UIApplicationWillChangeStatusBarOrientationNotification notifications.

Available in iPhone OS 2.0 and later.

Declared in UIApplication.h.

UIApplicationStatusBarFrameUserInfoKey

Accesses an NSValue object that encapsulates a CGRect structure expressing the location and size of the new status bar frame. This key is used with UIApplicationDidChangeStatusBarFrameNotification and UIApplicationWillChangeStatusBarFrameNotification notifications.

Available in iPhone OS 2.0 and later.

Declared in UIApplication.h.

UIApplicationLaunchOptionsURLKey

You use this key to access contents of the dictionary passed in the second parameter of the UIApplicationDelegate method application:didFinishLaunchingWithOptions:. It returns an NSURL object that another application specified in openURL:, which resulted in iPhone OS launching the application to handle the URL resource.

This key is also used to access the same value in the userInfo dictionary of the notification named UIApplicationDidFinishLaunchingNotification.

Available in iPhone OS 3.0 and later.

Declared in UIApplication.h.

UIApplicationLaunchOptionsSourceApplicationKey

You use this key to access contents of the dictionary passed in the second parameter of the UIApplicationDelegate method application:didFinishLaunchingWithOptions:. It returns an NSString object that represents the bundle ID of the application that requested the launch by calling openURL:.

This key is also used to access the same value in the userInfo dictionary of the notification named UIApplicationDidFinishLaunchingNotification.

Available in iPhone OS 3.0 and later.

Declared in UIApplication.h.

UIApplicationLaunchOptionsRemoteNotificationKey

You use this key to access contents of the dictionary passed in the second parameter of the UIApplicationDelegate method application:didFinishLaunchingWithOptions:. It returns a dictionary representing the payload of the remote notification.

See the description of application:didReceiveRemoteNotification: for further information. This key is also used to access the same value in the userInfo dictionary of the notification named UIApplicationDidFinishLaunchingNotification.

Available in iPhone OS 3.0 and later.

Declared in UIApplication.h.

Declared In
UIApplication.h

UIRemoteNotificationType

Constants indicating the types of notifications the application accepts.

typedef enum {
   UIRemoteNotificationTypeNone    = 0,
   UIRemoteNotificationTypeBadge   = 1 << 0,
   UIRemoteNotificationTypeSound   = 1 << 1,
   UIRemoteNotificationTypeAlert   = 1 << 2
} UIRemoteNotificationType;
Constants
UIRemoteNotificationTypeNone

The application accepts no notifications.

Available in iPhone OS 3.0 and later.

Declared in UIApplication.h.

UIRemoteNotificationTypeBadge

The application accepts notifications that badge the application icon.

Available in iPhone OS 3.0 and later.

Declared in UIApplication.h.

UIRemoteNotificationTypeSound

The application accepts alert sounds as notifications.

Available in iPhone OS 3.0 and later.

Declared in UIApplication.h.

UIRemoteNotificationTypeAlert

The application accepts alert messages as notifications.

Available in iPhone OS 3.0 and later.

Declared in UIApplication.h.

Discussion

One or more of the values in the UIRemoteNotificationType bit mask are passed to iPhone OS as the argument of the registerForRemoteNotificationTypes: method. Thereafter, iPhone OS filters notifications for the application based on these values. You can always get the current notification types by calling the enabledRemoteNotificationTypes method.

Availability
  • Available in iPhone OS 3.0 and later.
Declared In
UIApplication.h

Notifications

All UIApplication notifications are posted by the application instance returned by sharedApplication.

UIApplicationDidBecomeActiveNotification

Posted when the application becomes active.

An application is active when it is receiving events. An active application can be said to have focus. It gains focus after being launched, loses focus when an overlay window pops up or when the device is locked, and gains focus when the device is unlocked.

Availability
Declared In
UIApplication.h

UIApplicationDidChangeStatusBarFrameNotification

Posted when the frame of the status bar changes.

The userInfo dictionary contains an NSValue object that encapsulates a CGRect structure expressing the location and size of the new status bar frame. Use UIApplicationStatusBarFrameUserInfoKey to access this value.

Availability
Declared In
UIApplication.h

UIApplicationDidFinishLaunchingNotification

Posted immediately after the application finishes launching.

If the application was launched as a result of in remote notification targeted at it or because another application opened a URL resource claimed the posting application (the notification object), this notification contains a userInfo dictionary. You can access the contents of the dictionary using the UIApplicationLaunchOptionsURLKey and UIApplicationLaunchOptionsSourceApplicationKey constants (for URLs) or the UIApplicationLaunchOptionsRemoteNotificationKey constant (for remote notifications). If the notification was posted for a normal application launch, there is no userInfo dictionary.

Availability
Declared In
UIApplication.h

UIApplicationDidReceiveMemoryWarningNotification

Posted when the application receives a warning from the operating system about low memory availability.

This notification does not contain a userInfo dictionary.

Availability
Declared In
UIApplication.h

UIApplicationSignificantTimeChangeNotification

Posted when there is a significant change in time, for example, change to a new day (midnight), carrier time update, and change to or from daylight savings time.

This notification does not contain a userInfo dictionary.

Availability
Declared In
UIApplication.h

UIApplicationWillChangeStatusBarOrientationNotification

Posted when the application is about to change the orientation of its interface.

The userInfo dictionary contains an NSNumber that encapsulates a UIInterfaceOrientation value (see UIInterfaceOrientation). Use UIApplicationStatusBarOrientationUserInfoKey to access this value.

Availability
Declared In
UIApplication.h

UIApplicationDidChangeStatusBarOrientationNotification

Posted when the orientation of the application’s user interface changes.

The userInfo dictionary contains an NSNumber object that encapsulates a UIInterfaceOrientation value (see UIInterfaceOrientation). Use UIApplicationStatusBarOrientationUserInfoKey to access this value

Availability
Declared In
UIApplication.h

UIApplicationWillChangeStatusBarFrameNotification

Posted when the application is about to change the frame of the status bar.

The userInfo dictionary contains an NSValue object that encapsulates a CGRect structure expressing the location and size of the new status bar frame. Use UIApplicationStatusBarFrameUserInfoKey to access this value.

Availability
Declared In
UIApplication.h

UIApplicationWillResignActiveNotification

Posted when the application is no longer active and loses focus.

An application is active when it is receiving events. An active application can be said to have focus. It gains focus after being launched, loses focus when an overlay window pops up or when the device is locked, and gains focus when the device is unlocked.

Availability
Declared In
UIApplication.h

UIApplicationWillTerminateNotification

Posted when the application is about to terminate.

This notification does not contain a userInfo dictionary.

Availability
Declared In
UIApplication.h


Last updated: 2009-11-17

Did this document help you? Yes It's good, but... Not helpful...