小编DeS*_*ell的帖子

如何将我的iPhone应用程序转移到真正的iPhone?

我是一名注册的iOS开发人员.如何将我的iPhone应用程序转移到我的个人iPhone?

iphone xcode transfer

11
推荐指数
1
解决办法
6万
查看次数

MKMapView的用户位置在启动或恢复时出错

当我开始我的应用程序新鲜,或在很长一段时间后恢复,MKMapView的userLocation的概念是错误的,并显示我在海中.

我使用以下代码:

self.mapView.centerCoordinate = self.mapView.userLocation.location.coordinate;
[mapView setCenterCoordinate:self.mapView.userLocation.location.coordinate zoomLevel:ZOOM_LEVEL animated:YES];
Run Code Online (Sandbox Code Playgroud)

经过漫长的应用程序简历或全新的开始......

iphone mkmapview userlocation game-center

9
推荐指数
2
解决办法
6895
查看次数

当用户位置已知或更改时,如何以可视方式居中显示MKMapView地图?

我已阅读并按照说明如何在没有CLLocationManager的情况下将MKMapView缩放到用户当前位置?

然而,虽然我确实得到了当前的用户位置,但我实际上无法使地图在视觉上居中.

例如,在viewDidLoad函数中,如何使地图围绕用户已知位置进行可视化居中?我已粘贴下面CurrentLocation的代码(请参阅viewDidLoad中的XXX注释


#import "MapViewController.h"
#import "PlacemarkViewController.h"

@implementation MapViewController

@synthesize mapView, reverseGeocoder, getAddressButton;

- (void)viewDidLoad
{
    [super viewDidLoad];

    // XXX HERE: How can I cause self.mapView to actually recenter itself at self.mapview.userLocation.location?


    mapView.showsUserLocation = YES;
}

- (void)viewDidUnload
{
    self.mapView = nil;
    self.getAddressButton = nil;
}

- (void)dealloc
{
    [reverseGeocoder release];
    [mapView release];
    [getAddressButton release];

    [super dealloc];
}

- (IBAction)reverseGeocodeCurrentLocation
{
    self.reverseGeocoder =
        [[[MKReverseGeocoder alloc] initWithCoordinate:mapView.userLocation.location.coordinate] autorelease];
    reverseGeocoder.delegate = self;
    [reverseGeocoder start];
}

- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error
{ …
Run Code Online (Sandbox Code Playgroud)

iphone center map mkmapview userlocation

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

iphone ×3

mkmapview ×2

userlocation ×2

center ×1

game-center ×1

map ×1

transfer ×1

xcode ×1