Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

lyah01

macrumors newbie
Original poster
Jun 12, 2009
1
0
I developped a location-based application on iphone which uses CoreLocation.framework and I can't read the property CLLocationSpeed of the framework, described in the class CLLocation.h though it appears in my CLLocation.h file like it : "@property(readonly, nonatomic) CLLocationSpeed speed __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_2_2);" and my sdk runs with sdk 3.0.

In my code I have the same architecture than the tutoriel Hello There (http://www.mobileorchard.com/hello-there-a-corelocation-tutorial/).

Here is a sample of my code not working :

Code:
- (void)locationUpdate:(CLLocation *)location {
	
	CLLocationCoordinate2D loc = [location coordinate];
	NSLog(@"lat : %f lon %f", loc.latitude, loc.longitude);

	//here it crashes
	CLLocationSpeed *speed = location.speed;

Compilation display 3 errors :
error: 'CLLocationSpeed' undeclared (first use in this function)
error: 'speed' undeclared (first use in this function)
error: request for member 'speed' in something not a structure or union


Does anyone have an idea? I read all forums and never find the same problem.

Thanks
 
use
CLLocationSpeed speed = location.speed;

instead of
CLLocationSpeed *speed = location.speed;
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.