my partial code to store location with image.
CLLocation *location = self.filteredLocation ;
NSNumber *latitude = [NSNumber numberWithDouble:self.filteredLocation.coordinate.latitude];
NSNumber *longitude = [NSNumber numberWithDouble:self.filteredLocation.coordinate.longitude];
Now since i live in india..i always get the latitude and longitude in positive values.
The current situation is that latitude and longitude comes as 28 and 72 respectively …so no + sign before them…however if i log location ..it shows the values with +.
i want to know if – will come if app is somewhere in that region..i can’t test it in simulator ..since this code comes after code of AVCaptureStillImageOutput photo capture..which isn’t available in simulator.
My other doubts :
- Any way to get location with avfoundation itself.
- i take the image at around 2-3 seconds after the app starts..right
now i get the location in this much time..can anyone confirm if
location manager is usually fast..or if i can make something to catch
location fastest way.
Thanks
For your purpose you can use predefined coordinate of location.
Example
self.filteredLocation = CLLocationCoordinate2DMake(53.3,-2.371).(set it initially as well as in location delegate, because if it gets called then we will still have this location as current one).
so when you will log self.filteredLocation it will show
< +53.3,-2.371 >in its description.AVFoundationframework does not have any way to do this. As apple has provide CoreLocation framework for this purpose.Even
CoreLocationManagerwill be unable to tell you about its fastness. It depends on the device’s previous location history. If you are accessing your current location for the very first time then it will take time, but if you have accessed it just in previous run then it will be quicker.*Correction:*
It’s my mistake that I have assigned CLLocationCoordinate2D to a CLLocation object.
it should be :
CLLocation *location = [[CLLocation alloc] initWithLatitude:+53.3 longitude:-2.371];
or you can use other method for initialization.
Now when you will convert any of this double(latitude/longitude) in NSNumber it will have its property(signed/unsigned) with it. So it it is negative then NSNumber will be negative.