I have been trying to add a link to Google Maps so that I can show some directions to a location. The only problem i'm having is the code not recognizing the method. Here's samples below, hope they help.
.h:
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
@interface More : UIViewController{
}
- (IBAction)directions:(id)sender;
-(CLLocationCoordinate2D)getCurrentLocation;
@end
.m:
- (IBAction)directions:(id)sender {
CLLocationCoordinate2D currentLocation = [self getCurrentLocation];
NSString* address = @"********";
NSString* url = [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=%f,%f&daddr=%@",
currentLocation.latitude, currentLocation.longitude,
[address stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[[UIApplication sharedApplication] openURL: [NSURL URLWithString:url]];
}
Error: Method definition for 'getCurrentLocation not found
Thanks