问题描述
|
我的头文件:
@interface MapViewController : UIViewController <MKMapViewDelegate,NSFetchedResultsControllerDelegate>
{
MKMapView *mapView;
NSFetchedResultsController *fetchedResultsController;
NSManagedObjectContext *managedObjectContext;
}
@property (nonatomic,retain) MKMapView *mapView;
@property (nonatomic,retain) NSFetchedResultsController *fetchedResultsController;
@property (nonatomic,retain) NSManagedObjectContext *managedObjectContext;
我也在.m文件中进行合成。
在我的viewDidLoad函数中,我有这个(视图通过父控制器中的动画淡入):
- (void)viewDidLoad
{
[super viewDidLoad];
mapView = [[MKMapView alloc] initWithFrame:self.view.frame];
mapView.mapType = MKMapTypeSatellite;
mapView.delegate = self;
self.view = mapView;
[self.view setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight];
self.view.alpha = 0.0;
MKCoordinateRegion region;
MKCoordinateSpan span;
region.center.latitude = 42.764705;
region.center.longitude = -94.047375;
span.latitudeDelta=.02;
span.longitudeDelta=.02;
region.span = span;
[mapView setRegion:region animated:YES];
NSLog(@\"Change this1\");
}
这很好。
我还有另一个功能:
- (void)setInitialMapView
{
MKCoordinateRegion region;
MKCoordinateSpan span;
region.center.latitude = 32.764705;
region.center.longitude = -84.047375;
span.latitudeDelta=50.0;
span.longitudeDelta=50.0;
region.span = span;
[mapView setRegion:region animated:YES];
NSLog(@\"Change this 2\");
}
动画制作完成后,我将其称为第二个函数。
第二个功能不会更改地图的区域,但会打印到日志。因此正在调用该函数。
我在这里做错了什么?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)