Instance Method

beginGeneratingDeviceOrientationNotifications

Begins the generation of notifications of device orientation changes.

Declaration

- (void)beginGeneratingDeviceOrientationNotifications;

Discussion

You must call this method before attempting to get orientation data from the receiver. This method enables the device’s accelerometer hardware and begins the delivery of acceleration events to the receiver. The receiver subsequently uses these events to post UIDeviceOrientationDidChangeNotification notifications when the device orientation changes and to update the orientation property.

You may nest calls to this method safely, but you should always match each call with a corresponding call to the endGeneratingDeviceOrientationNotifications method.

See Also

Tracking the Device Orientation

orientation

Returns the physical orientation of the device.

UIDeviceOrientation

The physical orientation of the device.

generatesDeviceOrientationNotifications

A Boolean value that indicates whether the receiver generates orientation notifications (YES) or not (NO).

- endGeneratingDeviceOrientationNotifications

Ends the generation of notifications of device orientation changes.