Xcode MapKit MapView注释在真实设备上重叠

Xcode MapKit MapView注释在真实设备上重叠,xcode,ios,mkmapview,mkannotationview,Xcode,Ios,Mkmapview,Mkannotationview,在真实设备iPhone3G 3.1.3上测试我的应用程序时,我遇到了图中描述的问题。 在带有ios 4.1 sdk的模拟器xcode 3中,这是很好的。对不起,现在还不能发布图片,这是我的第一个问题 在注释的实现中,我有以下代码: - (id)initWithLocation:(CLLocationCoordinate2D)coord { self = [super init]; if (self) { coordinate = coord; } return self; } 这是头文

在真实设备iPhone3G 3.1.3上测试我的应用程序时,我遇到了图中描述的问题。 在带有ios 4.1 sdk的模拟器xcode 3中,这是很好的。对不起,现在还不能发布图片,这是我的第一个问题

在注释的实现中,我有以下代码:

- (id)initWithLocation:(CLLocationCoordinate2D)coord {
self = [super init];
if (self) {
    coordinate = coord;
}
return self;
}
这是头文件的一部分:

@interface MyAnnotation : NSObject <MKAnnotation>

有什么想法吗?我不知道该看什么:/

点击注释视图时,可以尝试将其置于前面

因此,当有人点击注释时,您应该调用[[self superview]bringsubview tofront:self]

最好的,
Christian

当有人点击注释时,我该如何检测?而且,这听起来像是对在模拟器上工作但在手机上不工作的东西的攻击,所以我试图弄清楚这是iOS bug还是我的错…我最终使用了你的建议:我必须重写MKPinAnnotationView,并在touchsbegind方法中使用你的代码。谢谢
MyAnnotation *theAnnotation = [[MyAnnotation alloc]  initWithLocation:theCoordinate];
theAnnotation.title = [single objectForKey:@"address"];
theAnnotation.objID = [single objectForKey:@"id"];

[self.mapView addAnnotation:theAnnotation];
[theAnnotation release];