Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try This</p> <pre><code>for ( int i=0; i&lt;[yourLatLongarray count]; i++) { CLLocationCoordinate2D coord; coord.latitude=[[NSString stringWithFormat:@"%@",[yourLatitudeArray objectAtIndex:i]] floatValue]; coord.longitude=[[NSString stringWithFormat:@"%@", [yourLongitudeArray objectAtIndex:i]] floatValue]; MKCoordinateRegion region1; region1.center=coord; region1.span.longitudeDelta=20 ; region1.span.latitudeDelta=20; [mapview setRegion:region1 animated:YES]; NSString *titleStr =[namesArr objectAtIndex:i] ; // NSLog(@"title is:%@",titleStr); MyAnnotation* annotObj =[[MyAnnotation alloc]initWithCoordinate:coord title:titleStr]; [mapview addAnnotation:annotObj]; } </code></pre> <p>MyAnnotation.h is </p> <pre><code>@interface MyAnnotation : NSObject &lt;MKAnnotation&gt; { CLLocationCoordinate2D coordinate; NSString *title; NSString *subTitle; NSString *time; } @property (nonatomic)CLLocationCoordinate2D coordinate; @property (nonatomic, retain) NSString *title; @property (nonatomic, retain) NSString *subTitle; @property (nonatomic,retain) NSString *time; -(id)initWithCoordinate:(CLLocationCoordinate2D) c title:(NSString *) t subTitle:(NSString *)timed time:(NSString *)tim; -(id)initWithCoordinate:(CLLocationCoordinate2D) c title:(NSString *)tit; @end </code></pre> <p>MyAnnotation.m is</p> <pre><code>@implementation MyAnnotation @synthesize coordinate; @synthesize title; @synthesize time; @synthesize subTitle; -(id)initWithCoordinate:(CLLocationCoordinate2D) c title:(NSString *) t subTitle:(NSString *)timed time:(NSString *)tim { self.coordinate=c; self.time=tim; self.subTitle=timed; self.title=t; return self; } -(id)initWithCoordinate:(CLLocationCoordinate2D) c title:(NSString *)tit { self.coordinate=c; self.title=tit; return self; } @end </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload