Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Draw This
($0.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-31-2009, 11:06 AM   #1 (permalink)
azimo
Registered Member
 
Join Date: Jul 2009
Posts: 29
azimo is on a distinguished road
Default My gps position is always (null)

I've used this code to get my position and it is normally logged so I can see it works.

Code:
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
	
	if (startingPoint == nil)
		self.startingPoint = newLocation;
	
	NSString *latitudeString = [[NSString alloc] initWithFormat:@"%g°", newLocation.coordinate.latitude];
	NSLog(@"%@", latitudeString);
	self.myLatitude = latitudeString;
	[latitudeString release];
	
	NSString *longitudeString = [[NSString alloc] initWithFormat:@"%g°", newLocation.coordinate.longitude];
	NSLog(@"%@", longitudeString);
	self.myLongitude = longitudeString;
	[longitudeString release];
	
}
But I need to use my position with a webservice, so I logged the two variables on viewLoad, but they are always (null).
Can someone suggest me how can I access the two coordinates outside the didUpdateToLocation method?
Thanks in advance.
azimo is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,016
Threads: 93,863
Posts: 401,918
Top Poster: BrianSlick (7,962)
Welcome to our newest member, livelifelove52
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:52 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.