複数の注釈を使用してマップを作成していますが、どのように動的かわかりません (CoreData にそれらがあります)。
私はこのコードでそれらを修正しています:
- (void)viewDidLoad {
    [super viewDidLoad];
    CLLocation *userLoc = mapView.userLocation.location;
    CLLocationCoordinate2D userCoordinate = userLoc.coordinate;
    NSLog(@"user latitude = %f",userCoordinate.latitude);
    NSLog(@"user longitude = %f",userCoordinate.longitude);
    mapView.delegate=self;
     NSMutableArray* annotations=[[NSMutableArray alloc] init];
    CLLocationCoordinate2D theCoordinate1;
    theCoordinate1.latitude = 43.82078;
    theCoordinate1.longitude = 15.307265;
    CLLocationCoordinate2D theCoordinate2;
    theCoordinate2.latitude = 44.91035917;
    theCoordinate2.longitude = 14.65576172;
    MyAnnotation* myAnnotation1=[[MyAnnotation alloc] init];
    myAnnotation1.coordinate=theCoordinate1;
    myAnnotation1.title=@"Rohan";
    myAnnotation1.subtitle=@"in the city";
    MyAnnotation* myAnnotation2=[[MyAnnotation alloc] init];
    myAnnotation2.coordinate=theCoordinate2;
    myAnnotation2.title=@"Vaibhav";
    myAnnotation2.subtitle=@"on a Bridge";
    [mapView addAnnotation:myAnnotation1];
    [mapView addAnnotation:myAnnotation2];
    [annotations addObject:myAnnotation1];
    [annotations addObject:myAnnotation2];
    NSLog(@"%d",[annotations count]);
    //[self gotoLocation];//to catch perticular area on screen
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
    // Walk the list of overlays and annotations and create a MKMapRect that
    // bounds all of them and store it into flyTo.
    MKMapRect flyTo = MKMapRectNull;
    for (id <MKAnnotation> annotation in annotations) {
        NSLog(@"fly to on");
        MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate);
        MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0, 0);
        if (MKMapRectIsNull(flyTo)) {
            flyTo = pointRect;
        } else {
            flyTo = MKMapRectUnion(flyTo, pointRect);
            //NSLog(@"else-%@",annotationPoint.x);
        }
    }
    // Position the map so that all overlays and annotations are visible on screen.
    mapView.visibleMapRect = flyTo;
    UIBarButtonItem* temp=[[UIBarButtonItem alloc] init];
    temp.title=@"Back";
    self.navigationItem.backBarButtonItem=temp;
    //[temp release];
}
PS追加のコードが必要な場合は、教えてください。
手伝ってくれてありがとう
アップデート:
Locations.h
...
@interface Locations : NSManagedObject
@property (nonatomic, retain) NSDecimalNumber * lat;
@property (nonatomic, retain) NSDecimalNumber * lon;
...
更新 2:
これは、注釈を「固定」するコードの例です。
http://dl.dropbox.com/u/77033905/stackoverflow/Map.zip
この注釈を配列に追加するにはどうすればよいですか? この場所を定義します(座標、タイトル、サブタイトルを配列で定義し、それらをマップに追加します。)