views:

21

answers:

1

this is my code:

    CLLocationCoordinate2D location1;

for(int i=0;i<[appDelegate.books count];i++)
{   

    Book *aBook= [appDelegate.books objectAtIndex:i];
     NSLog(@"Reading id value :%f",aBook.Latitude);     
    location1.latitude=aBook.Latitude;
    location1.longitude=aBook.Longitude;

    addAnnotation = [[AddressAnnotation alloc] initWithCoordinate:location];
    [mapView addAnnotation:addAnnotation];

here aBook is the object that have the 
 latitude and longitude value.
   i want to assign the value of 
 aBook.latitude to   aBook.longitude to
 ClLocationcoordinate object location1

   but i am not getting the output,
  in consol window i am getting the 0 value 
  when i am trying to print. 

  how can i access the value of aBook.latitude.
A: 

It would seem that your aBook objects's Latitude/Longitude values aren't floats. They are some other type, which you need to convert to a float. So you should find out what type they are (presumably an NSString or an NSNumber).

Paul Lynch