-(void)openMaps:(id)sender{
NSString *addressText = @"1 Queen st, Auckland,NZ";
addressText = [addressText stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
NSString * urlText = [NSString stringWithFormat:@"http://maps.google.com/maps?q=%@",addressText];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlText]]; }
实现如上代码,即可;
效果:
参考
www.blog.sina.com.cn/s/blog_5fae23350100dmln.html