このエラーは、Xcodeバージョン 5.0でのみ発生します
このアプリを Xcodeバージョン 4.6.2で作成する前は、非常にうまく機能していましたが、Xcodeバージョン 5.0でこのエラーが発生しました
更新された場所と住所を生成するためのカスタム Annotation クラスを作成しました。
私のコードは:
AnnotationView.h
#import <MapKit/MapKit.h>
@interface AnnotationView : MKPlacemark
@property (nonatomic, readwrite, assign) CLLocationCoordinate2D coordinate;
@property (nonatomic, strong) NSString *title;
@property (nonatomic, strong) NSString *subtitle;
@end
AnnotationView.m
#import "AnnotationView.h"
@implementation AnnotationView
- (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate addressDictionary:(NSDictionary *)addressDictionary
{
if ((self = [super initWithCoordinate:coordinate addressDictionary:addressDictionary]))
{
self.coordinate = coordinate;
}
return self;
}
@end
上記は私のカスタムクラスです。MapViewで使用しました。
CLLocationCoordinate2D theCoordinate ;
theCoordinate.latitude = [self.latitude doubleValue];
theCoordinate.longitude = [self.longitude doubleValue];
AnnotationView *annotation = [[AnnotationView alloc] initWithCoordinate:theCoordinate addressDictionary:nil] ;
annotation.title = self.businessName;
annotation.subtitle = self.businessAddress;
[self.mapView addAnnotation:annotation];
MKCoordinateRegion adjustedRegion = [self.mapView regionThatFits:MKCoordinateRegionMakeWithDistance(theCoordinate, 8000, 8000)];
[self.mapView setRegion:adjustedRegion animated:YES];
どこが間違っているか教えてください。