0

我想创建一个应用程序来显示我在谷歌地图中的位置,但是当运行这个应用程序时不显示我的位置并显示旧金山的另一个位置!为什么不告诉我我在我所在城市的位置???这是我的代码:

视图控制器.m

#import "ViewController.h"
#import <MapKit/MapKit.h>

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    MKMapView *mapView = [[MKMapView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)];
    mapView.mapType = MKMapTypeStandard;
    mapView.zoomEnabled = YES;
    mapView.scrollEnabled = YES;
    mapView.showsUserLocation = YES;

    [self.view addSubview:mapView];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
4

0 回答 0