title: CoreLocation manager not updating locations
body: <p>I was trying to implement a separate class for managing my location. I wanted to get my location whenever I click a button.</p>
  
  <p><code>gpsFilter.h</code></p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  #import &lt;CoreLocation/CoreLocation.h&gt;
  
  @interface gpsFilter : NSObject &lt;CLLocationManagerDelegate&gt;
  
  @property (nonatomic, retain) CLLocationManager *gpsManager;
  @property (nonatomic, retain) NSString * latitude;
  @property (nonatomic, retain) NSString * longitude;
  @end
  </code></pre>
  
  <p><code>gpsFilter.m</code>.</p>
  
  <pre><code>#import "gpsFilter.h"
  
  @implementation gpsFilter
  
  - (id) init{
  self = [super init];
  if(self != nil){
      self.gpsManager = [[CLLocationManager alloc] init];
      self.gpsManager.delegate = self;
      [self.gpsManager startUpdatingLocation];
      BOOL enable = [CLLocationManager locationServicesEnabled];
      NSLog(@"%@", enable? @"Enabled" : @"Not Enabled");
  }
  return self;
  }
  
  - (void)gpsManager:(CLLocationManager *) manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation{
  NSLog(@"didUpdateToLocation: %@", newLocation);
  CLLocation *currentLocation = newLocation;
  if(currentLocation != nil){
      self.latitude = [NSString stringWithFormat:@"%.8f", currentLocation.coordinate.longitude];
      self.longitude = [NSString stringWithFormat:@"%.8f", currentLocation.coordinate.latitude];
  }
  }
  
  - (void)gpsManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
  {
  NSLog(@"didFailWithError: %@", error);
  }
  @end
  </code></pre>
  
  <p>I am using a separate class because I wanted to add smoothing filter in the future. I don't get any updates. The NSLog is never triggered. I think some variable is getting autoreleased, but I am not sure, which one.</p>
  
  <p>The viewController code is as follows.</p>
  
  <pre><code>#import "gpstestViewController.h"
  
  @interface gpstestViewController (){
  
  }
  
  @end
  
  @implementation gpstestViewController
  
  
  - (void)viewDidLoad
   {
  [super viewDidLoad];
  self.location = [[gpsFilter alloc] init];
  // Do any additional setup after loading the view, typically from a nib.
  }
  
  
  - (IBAction)getloca:(id)sender {
  self.latitudeLabel.text = [self.location latitude];
  self.longitudeLabel.text = [self.location longitude];
  
  }
  
  - (IBAction)getLocation:(id)sender {
  self.latitudeLabel.text = [self.location latitude];
  self.longitudeLabel.text = [self.location longitude];
  
  }
  @end
  </code></pre>
  
  <p>I am sorry that I am dumping a lot of code, but I am a newbie to ios programming and I am not able to find what the problem is.</p>
  
  <p>EDIT: The updateLocation delegate method is not being called at all. </p>