Case:
I need to get the Lat Long and submit to a web server.
I followed the sample codes to get the lat/long using the LocationManager and then was able to submit the data to my webserver using the NSURL.
I want to start a new thread on each click of a button on my app (which would do the above process) because I do not want to wait for the LocationManager to complete the task of getting Lat/Long data (Which is taking few seconds time and the app does not allow me to click on any other buttons).
So I started of like this.
But when I do this my didUpdateToLocation: is not getting called.
Can someone guide me on if I am moving in the right direction or missing something.
Thanks for the help.
I need to get the Lat Long and submit to a web server.
I followed the sample codes to get the lat/long using the LocationManager and then was able to submit the data to my webserver using the NSURL.
I want to start a new thread on each click of a button on my app (which would do the above process) because I do not want to wait for the LocationManager to complete the task of getting Lat/Long data (Which is taking few seconds time and the app does not allow me to click on any other buttons).
So I started of like this.
Code:
[ NSThread detachNewThreadSelector: @selector(myThreadedMethod) toTarget: self withObject: nil ];
Code:
- (void)myThreadedMethod
{
NSAutoreleasePool *pool = [ [ NSAutoreleasePool alloc ] init ];
locmanager = [[CLLocationManager alloc] init];
[locmanager setDelegate:self];
[locmanager setDesiredAccuracy:kCLLocationAccuracyBest];
[locmanager startUpdatingLocation];
[ pool release ];
}
But when I do this my didUpdateToLocation: is not getting called.
Can someone guide me on if I am moving in the right direction or missing something.
Thanks for the help.