daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Jan 12th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. NSNumber conversion-pair latitude and longitude
  2. NSNumber *a;
  3.  
  4. for(NSDictionary *item in[res valueForKey:@"snapshot"])
  5. {
  6. a=[item valueForKey:@"lat"];
  7. NSLog(@"%@",a);
  8. b=[item valueForKey:@"lng"];
  9. NSLog(@"%@",b);
  10. }
  11.    
  12. for(NSDictionary *item in[res valueForKey:@"snapshot"])
  13. {
  14.     NSArray* latitudesList  = [item valueForKey:@"lat"];
  15.     NSArray* longitudesList = [item valueForKey:@"lng"];
  16.     NSInteger idx = 0;
  17.     NSInteger nb = MIN( latitudesList.count , longitudesList.count );
  18.     for(NSInteger idx = 0; idx < nb; ++idx)
  19.     {
  20.       double lat = [[latitudesList  objectAtIndex:idx] doubleValue];
  21.       double lng = [[longitudesList objectAtIndex:idx] doubleValue];
  22.       NSLog(@"Pair #%d = { %f , %f }", idx, lat, lng);
  23.     }
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top