title: Getting wrong location on GPS in iPhone
body: <p>Tried different methods using core location frame work in iOS but not getting exact location through GPS. Even the apple maps &amp; google maps are not pointing to correct location. See the code snippet I'm using:</p>
  
  <blockquote>
    <p>MyLocation class header file</p>
  </blockquote>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  #import &lt;CoreLocation/CoreLocation.h&gt;
  
  @interface MyLocation : NSObject&lt;CLLocationManagerDelegate&gt; {
  CLLocationManager *locationManager;
  }
  </code></pre>
  
  <blockquote>
    <p>MyLocation class m file</p>
  </blockquote>
  
  <pre><code>  #import "MyLocation.h"
      #import &lt;CoreTelephony/CTCarrier.h&gt;
      #import &lt;CoreTelephony/CTTelephonyNetworkInfo.h&gt;
  
      @implementation MyLocation
  
      @synthesize curLocation;
  
      -(id)init{
  
      locationManager = [[CLLocationManager alloc] init];
      locationManager.delegate = self;
      locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters;
      locationManager.distanceFilter = 0;
  
      //locationManager.distanceFilter = kCLDistanceFilterNone;
      //locationManager.desiredAccuracy = kCLLocationAccuracyBest;
  
      [self updateLocation];
  
      curLocation = CGPointZero;
      return self;
  
      }
  
      -(void)updateLocation{
  
      [locationManager startUpdatingLocation];
  
      }
  
      - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
  
  
  
  
      curLocation  = CGPointMake( newLocation.coordinate.latitude, newLocation.coordinate.longitude);
  
      }
  </code></pre>