this code is not working on device but on simultor ?? any idea i have 3Gs i think
<p>i want to embed compass on my application can any one help me plz</p>

<pre><code>- (void)viewDidLoad {

    locationManager=[[CLLocationManager alloc] init];
    locationManager.desiredAccuracy = kCLLocationAccuracyBest;
    locationManager.delegate=self;
    //Start the compass updates.
    //[self.locationManager startUpdatingHeading];
    [[self locationManager] startUpdatingHeading];

    [super viewDidLoad];
}

- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
{
    NSLog(@"New magnetic heading: %f", newHeading.magneticHeading);
    NSLog(@"New true heading: %f", newHeading.trueHeading);
}
</code></pre>

<p>this code is not working on device its only running on simulator??? any idea ???</p>
