0
在真實設備(iPhone 3G,3.1.3)上測試我的應用程序時,我遇到了圖像中描述的問題。 在模擬器(xcode 3與ios 4.1 sdk)中很好。抱歉,無法發佈圖片,這是我的第一個問題。MapKit MapView在真實設備上重疊的註釋
http://i.stack.imgur.com/Ct4on.jpg
我在註釋中執行以下代碼:
- (id)initWithLocation:(CLLocationCoordinate2D)coord {
self = [super init];
if (self) {
coordinate = coord;
}
return self;
}
這是頭文件的一部分:
@interface MyAnnotation : NSObject <MKAnnotation>
而這正是我創建一個新的(在一個循環內):
MyAnnotation *theAnnotation = [[MyAnnotation alloc] initWithLocation:theCoordinate];
theAnnotation.title = [single objectForKey:@"address"];
theAnnotation.objID = [single objectForKey:@"id"];
[self.mapView addAnnotation:theAnnotation];
[theAnnotation release];
有關於此的任何想法?我不知道該看什麼:/
如何檢測,當有人在註釋水龍頭?而且,這聽起來像的東西,一個黑客的作品在模擬器上,但不是在手機上,所以我試圖找出這是一個iOS錯誤還是我的錯...... – koichirose 2011-04-25 17:19:42
我最終使用了你的建議:我不得不重寫MKPinAnnotationView,並在「 touchesBegan「方法。謝謝! – koichirose 2011-04-27 17:28:01