Guest User

Untitled

a guest
Jan 12th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment