长话短说:
如何直接在硬件(iPhone)上调试iPhone-App,其版本/二进制文件与AppStore完全相同,而无需等待AppStore-Preview-Process?
恩细节:
我发现在使用Developer Profile通过XCode/USB-Cable在iPhone上运行的编译IPA之间以及在Distribution-To-AppStore-Process之后直接从AppStore安装的版本之间,MKMapView的行为存在很大差异.
我将附上两个重要的截图.
这就是应用程序如何通过XCode/USB-Cable在iPhone上启动MKMapView,指向具有特殊区域的当前用户位置:
这就是在AppStore安装分布式版本后,同一个App在同一个iPhone上启动的方式,而不需要对前一个版本进行任何代码更改:
在这里,我将提供一些代码:
- (void)viewDidLoad { [super viewDidLoad]; [self.mapView removeAnnotations:[self.mapView annotations]]; CLLocationCoordinate2D noLocation; MKCoordinateRegion viewRegion = MKCoordinateRegionMakeWithDistance(noLocation, 6500, 6500); MKCoordinateRegion adjustedRegion = [self.mapView regionThatFits:viewRegion]; [self.mapView setRegion:adjustedRegion animated:NO]; mapView.delegate = self; mapView.showsUserLocation = YES; mapView.mapType = MKMapTypeStandard; } - (void)mapView:(MKMapView *)theMapView didUpdateUserLocation:(MKUserLocation *)userLocation { theMapView.centerCoordinate = userLocation.location.coordinate; }
顺便说一句,仅供您参考:这里发生了由XCode直接在iPhone上运行的IPA和通过AppStore发布的分布式存档之间的另一个区别.没有Line"[self.mapView removeAnnotations:[self.mapView annotations]];" 应用程序在AppStore安装的版本中启动后直接崩溃,但从XCode运行时则没有.这个问题我在之前的版本中遇到过,并不是这个问题的一部分,只是对主要问题的补充
主要问题是:
调试iPhone-App是否可能与AppStore分发的方式完全相同,而无需等待AppStore-Preview-Process,如果是,如何调整?