Class: CLHeading

Inherits:
NSObject show all

Overview

A CLHeading object contains heading data generated by a CLLocationManager object. The heading data consists of computed values for true and magnetic north. It also includes the raw data for the three-dimensional vector used to compute those values.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from NSObject

#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version

Constructor Details

This class inherits a constructor from NSObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NSObject

Instance Attribute Details

- (CLLocationDirection) headingAccuracy (readonly)

The maximum deviation (measured in degrees) between the reported heading and the true geomagnetic heading. (read-only) A positive value in this property represents the potential error between the value reported by the magneticHeading property and the actual direction of magnetic north. Thus, the lower the value of this property, the more accurate the heading. A negative value means that the reported heading is invalid, which can occur when the device is uncalibrated or there is strong interference from local magnetic fields.

Returns:

  • (CLLocationDirection)

- (CLLocationDirection) magneticHeading (readonly)

The heading (measured in degrees) relative to magnetic north. (read-only) The value in this property represents the heading relative to the magnetic North Pole, which is different from the geographic North Pole. The value 0 means the device is pointed toward magnetic north, 90 means it is pointed east, 180 means it is pointed south, and so on. The value in this property should always be valid.In iOS 3.x and earlier, the value in this property is always measured relative to the top of the device in a portrait orientation, regardless of the device’s actual physical or interface orientation. In iOS 4.0 and later, the value is measured relative to the heading orientation specified by the location manager. For more information, see the headingOrientation property in CLLocationManager Class Reference.If the headingAccuracy property contains a negative value, the value in this property should be considered unreliable.

Returns:

  • (CLLocationDirection)

- (NSDate) timestamp (readonly)

The time at which this heading was determined. (read-only)

Returns:

- (CLLocationDirection) trueHeading (readonly)

The heading (measured in degrees) relative to true north. (read-only) The value in this property represents the heading relative to the geographic North Pole. The value 0 means the device is pointed toward true north, 90 means it is pointed due east, 180 means it is pointed due south, and so on. A negative value indicates that the heading could not be determined. In iOS 3.x and earlier, the value in this property is always measured relative to the top of the device in a portrait orientation, regardless of the device’s actual physical or interface orientation. In iOS 4.0 and later, the value is measured relative to the heading orientation specified by the location manager. For more information, see the headingOrientation property in CLLocationManager Class Reference.Important: This property contains a valid value only if location updates are also enabled for the corresponding location manager object. Because the position of true north is different from the position of magnetic north on the Earth’s surface, Core Location needs the current location of the device to compute the value of this property.

Returns:

  • (CLLocationDirection)

- (CLHeadingComponentValue) x (readonly)

The geomagnetic data (measured in microteslas) for the x-axis. (read-only) This value represents the x-axis deviation from the magnetic field lines being tracked by the device.

Returns:

  • (CLHeadingComponentValue)

- (CLHeadingComponentValue) y (readonly)

The geomagnetic data (measured in microteslas) for the y-axis. (read-only) This value represents the y-axis deviation from the magnetic field lines being tracked by the device.

Returns:

  • (CLHeadingComponentValue)

- (CLHeadingComponentValue) z (readonly)

The geomagnetic data (measured in microteslas) for the z-axis. (read-only) This value represents the z-axis deviation from the magnetic field lines being tracked by the device.

Returns:

  • (CLHeadingComponentValue)

Instance Method Details

- (String) description

Returns the heading data in a formatted text string.

Returns:

  • (String)

    A string of the form “magneticHeading trueHeading accuracy x y z @ ” where , , , , , and are formatted floating-point numbers and is a formatted date string that includes date, time, and time zone information.