title: make a compass application in iPad
body: <p>I would like to make a compass application that will specify the geographic directions(north, east, west, south),</p>
  
  <p>So i used CoreLocation framework in my application. I found in many forums that when this function <code>[locationManager startUpdatingHeading];</code> calls it will automatically call the function: <code>-(void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading</code></p>
  
  <p>But in my application the second function is not automatically invoked, so i cant able to make my application, Please help me.......
  My code is given bellow:</p>
  
  <pre><code>-(void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
  {
      NSLog(@"New magnetic heading: %f", newHeading.magneticHeading);
      NSLog(@"New true heading: %f", newHeading.trueHeading);
      NSString *headingstring = [[NSString alloc] initWithFormat:@"%f",newHeading.trueHeading];
      trueHeading.text = headingstring;
      [headingstring release];
  
      NSString *magneticstring = [[NSString alloc] initWithFormat:@"%f",newHeading.magneticHeading];
      magneticHeading.text = magneticstring;
      [magneticstring release];
  }
  
  // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
  - (void)viewDidLoad {
  
      [super viewDidLoad];
  
      locationManager=[[CLLocationManager alloc] init];
      locationManager.desiredAccuracy = kCLLocationAccuracyBest;
      locationManager.delegate=self;
      //Start the compass updates.
      if (CLLocationManager.headingAvailable ) {     
          [locationManager startUpdatingHeading];
      }
      else {
          NSLog(@"No Heading Available: ");
          UIAlertView *noCompassAlert = [[UIAlertView alloc] initWithTitle:@"No Compass!" message:@"This device does not have the ability to measure magnetic fields." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
          [noCompassAlert show];
          [noCompassAlert release];
      }
  }
  </code></pre>
  
  <h2>please help me</h2>
  
  <p>Sreekumar Kalarikkal
  India</p>