User Tools

Site Tools


ios-labs-s14:class-08

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ios-labs-s14:class-08 [2014/02/28 01:16]
mbarboi
ios-labs-s14:class-08 [2014/02/28 14:55] (current)
mbarboi
Line 216: Line 216:
   -Have it implement the protocol MKAnnotation by typing "<​MKAnnotation>"​ immediately after the superclass name in the header file   -Have it implement the protocol MKAnnotation by typing "<​MKAnnotation>"​ immediately after the superclass name in the header file
   -Import it into MapRoot   -Import it into MapRoot
 +  -Add the following properties to the header file
  
-When the user touches the trips button (the car icon) you should add the annotations. The method for adding annotations to a map is called //​addAnnotation//​. Create a new annotation object for each coordinate and add it to the map.+<​code>​ 
 +@property (nonatomic, copy) NSString * title; 
 +@property (nonatomic, copy) NSString * subtitle; 
 +@property (nonatomic, assign) CLLocationCoordinate2D coordinate;​ 
 +</​code>​ 
 + 
 +When the user touches the trips button (the car icon) you should add the annotations. The method for adding annotations to a map is called //​addAnnotation//​. Create a new annotation object for each start and stop coordinate and add it to the map. 
 + 
 +Note that the property called coordinate on the annotation object is of type CLLocationCoordinate2D-- you cannot pass the GPSCoordinate object! Instead, convert the lat and long from the GPSCoordinate object to the following helper function: 
 + 
 +  CLLocationCoordinate2DMake(LAT,​ LONG); 
 +   
 +Which returns an object of type CLLocation2D
  
 ====Create Overlay==== ====Create Overlay====
ios-labs-s14/class-08.1393571800.txt.gz · Last modified: 2014/02/28 01:16 by mbarboi