3
我有一个TabView,并且我的其中一个选项卡包含一个mapView。当我因为某种原因加载了带有mapView的选项卡时,会调用两次regionDidChangeAnimated。我已经在其他功能中加入了断点,并且禁止它们全部运行,所以它实际上只是拉起了一张空白的地图。尽管如此,regionDidChangeAnimated被调用两次。任何想法,为什么这可能是?mkMapView的regionDidChangeAnimated委托触发了两次标签加载
下面的代码:
SecondViewController.h:
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
@interface SecondViewController : UIViewController<MKMapViewDelegate>
{IBOutlet MKMapView *mapView;}
@end
SecondViewController.m
#import "SecondViewController.h"
@implementation SecondViewController
- (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated
{
//[self showTowers];
NSLog(@"regionDidChangeAnimated");
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
return self;
}
- (void)dealloc {
[super dealloc];
}
你是否改变了地图的中心或设置了地图的区域? – visakh7 2011-02-25 06:35:12
不需要,我会用代码更新我的问题。 – Sina 2011-02-25 06:48:10