先声明一个button 叫 myBtn
myBtn = [[UIButton alloc]initWithFrame:CGRectMake(50, 50, 100, 50)];
myBtn.backgroundColor = [UIColor grayColor];
[myBtn addTarget:self action:@selector(myButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:myBtn];
myButtonPressed函数
- (void) myButtonPressed:(id)sender{
CLLocationCoordinate2D myDst = CLLocationCoordinate2DMake(39.0, 121.0);
MKMapItem *dstLocation = [[MKMapItem alloc] initWithPlacemark:[[MKPlacemark alloc] initWithCoordinate:myDst addressDictionary:nil]];
dstLocation.name = @"大连理工大学软件学院";
[MKMapItem openMapsWithItems:@[dstLocation] launchOptions:@{MKLaunchOptionsMapCenterKey:[NSNumber numberWithBool:YES]}];
跳转到 39.0,121.0了 好像这是在海里但是