このようなエラーを修正する方法: 認識されないセレクターがインスタンスに送信されましたか?
CLLocationCoordinate2D userCoordinate = userLocation.location.coordinate;
CGFloat latDelta = rand()*.035/RAND_MAX -.02;
CGFloat longDelta = rand()*.03/RAND_MAX -.015;
CLLocationCoordinate2D newCoord = { userCoordinate.latitude + latDelta, userCoordinate.longitude + longDelta };
myPoint *mp = [[myPoint alloc] initWithCoordinate:newCoord title:[NSString stringWithFormat:@"Vitaliy Home %d",i] subTitle:@"Home Sweet Home"];
[mv addAnnotation:mp]; //mv - (MKMapView *)mv
エラーはオンラインです:
myPoint *mp = [[myPoint alloc] initWithCoordinate:newCoord title:[NSString stringWithFormat:@"Vitaliy Home %d",i] subTitle:@"Home Sweet Home"];
クラス myPoint:
@interface myPoint : NSObject<MKAnnotation> {
NSString *title;
NSString *subTitle;
CLLocationCoordinate2D coordinate;
}
@property (nonatomic,readonly) CLLocationCoordinate2D coordinate;
@property (nonatomic,copy) NSString *title;
@property (nonatomic,copy) NSString *subTitle;
- (id)initWithCoordinate:(CLLocationCoordinate2D) c title:(NSString *) t subTitle:(NSString *) st;
@end
ありがとうございました。