Search Results

Search found 17 results on 1 pages for 'mkreversegeocoder'.

Page 1/1 | 1 

  • OCmock and MKReverseGeocoder

    - by user315374
    Hi, I would like to test a method that uses reverse Geocoding. What i would like to do is : set the geocoder as a property of my controller create the geocoder in the init method call the geocoder in the method i want to test replace the geocoder with a mock in my test The problem is that the MKReverseGeocoder coordinate property is read only, i can only set it in the constructor method : [[MKReverseGeocoder alloc] initWithCoordinate:coord] And of course the coordinates are only available in the method i want to test.. Does anyone knows how i could mock the MKReverseGeocoder class ? Thanks in advance, Vincent.

    Read the article

  • iPhone -- MKReverseGeocoder.adminstrativeArea -- getting state abbreviation

    - by rayjohannessen
    In the documentation for MKReverseGeocoder, the administrativeArea property gives you the current state the user is in, and it mentions in an example that it returns EITHER the state name OR its abbreviation. I am wondering if anyone knows how to get the abbreviation instead of the full state name...I have been able to find nothing that shows this is even a possibility besides that brief example that doesn't mention HOW. Thanks!

    Read the article

  • MKReverseGeocoder only showing one placemark

    - by Taylor Satula
    Hi, Something is wrong with my code. It is only showing the final placemark when I try to show the Street and City on one line. I don't know what I am doing wrong (a beginner problem most likely). I hope someone can help my out. - (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark { [self doLog:[placemark.thoroughfare, placemark.locality description]]; if ([geocoder retainCount]) [geocoder release]; }

    Read the article

  • MKReverseGeocoder server returned error: 503

    - by raaz
    Hi all, Currently i am developing an iPhone application where i have to show user's current city and location for which i am using Mapkit Framework.When i build the application it works fine and show me the exact city details .But right now when i try to build the application again application shows following error message in my log /SourceCache/ProtocolBuffer_Sim/ProtocolBuffer-26/Runtime/PBRequester.m:523 server returned error: 503 reverseGeocoder: didFailWithError:Error Domain=PBRequesterErrorDomain Code=6001 "Operation could not be completed. (PBRequesterErrorDomain error 6001.)" Is any body facing the same issue and how can i resolve it?

    Read the article

  • MKReverseGeocoder delegate location?

    - by fuzzygoat
    I have a quick question regarding memory management that I am not quite sure about. I currently have a locationManager delegate that calls locationManager:didUpdateToLocation:fromLocation when it resolves the device location. My question is I am looking at adding ReverseGeoCoding after I have obtained the [newLocation coordinate] but am unsure about doing the alloc here, as each time locationManager:didUpdateToLocation:fromLocation gets called I will be alloc-ing a new MKReverseGeoCoder? // LOCATION -(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { // GeoCoding: MKReverseGeocoder *geoCoder = [[MKReverseGeocoder alloc] initWithCoordinate:[newLocation coordinate]]; [geoCoder setDelegate:self]; [geoCoder start]; [self foundLocation]; } Can anyone point me in the right direction with regards to this? I did try doing the alloc in application:didFinishLaunchingWithOptions: but then realised I did not have access to [newLocation coordinate]. many thanks gary

    Read the article

  • Reverse geocode without using MKReverseGeocoder

    - by SpH1nX
    Hi guys, I'm trying to detect current user address using MKReverseGeocoder passing coordinates obtained via CLLocation class. Reading MKReverseGeocoder Class Reference I noticed that The Google terms of service require that the reverse geocoding service be used in conjunction with a Google map; take this into account when designing your application's user interface. so I'm wondering if (and eventually how) can I reverse geocode user current location on iPhone OS SDK 3.1.3. I thought using Google Maps API but the EULA has the same obligation. Yahoo Maps API is even worse and Microsoft one aren't free.

    Read the article

  • Reverse geocode coordinates to street address and setting as subtitle in annotation?

    - by Krismutt
    Hey everybody! Basically I wanna reverse geocode my coordinates for my annotation and show the address as the subtitle for the annotation. I just cant figure out how to do it... savePosition.h #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> #import <MapKit/MKReverseGeocoder.h> #import <AddressBook/AddressBook.h> @interface savePosition : NSObject <MKAnnotation, MKReverseGeocoderDelegate> { CLLocationCoordinate2D coordinate; } @property (nonatomic, readonly) CLLocationCoordinate2D coordinate; -(id)initWithCoordinate:(CLLocationCoordinate2D) coordinate; - (NSString *)subtitle; - (NSString *)title; @end savePosition.m @synthesize coordinate; -(NSString *)subtitle{ return [NSString stringWithFormat:@"%f", streetAddress]; } -(NSString *)title{ return @"Saved position"; } -(id)initWithCoordinate:(CLLocationCoordinate2D) coor{ coordinate=coor; NSLog(@"%f,%f",coor.latitude,coor.longitude); return self; MKReverseGeocoder *geocoder = [[MKReverseGeocoder alloc] initWithCoordinate:coordinate]; geocoder.delegate = self; [geocoder start]; } - (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error { } - (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark{ NSString *streetAddress = [NSString stringWithFormat:@"%@", [placemark.addressDictionary objectForKey:kABPersonAddressStreetKey]]; } @end any ideas?? Thanks in advance!

    Read the article

  • using performSelector

    - by zebra
    Hi all, i've my method that implement a reverseGeocoder - (void)reversing { geoCoder=[[MKReverseGeocoder alloc] initWithCoordinate:locManager.location.coordinate]; geoCoder.delegate=self; [geoCoder start]; } i recall reversing in another method with this: [self performSelector:@selector(reversing) withObject:nil afterDelay:10]; and i receive 2010-04-30 17:44:17.616 high[1167:207] Retrive City Milano 2010-04-30 17:44:17.628 high[1167:207] geocoder released 2010-04-30 17:44:18.723 high[1167:207] Error Domain=MKErrorDomain Code=4 "Operation could not be completed. (MKErrorDomain error 4.)" Program received signal: “EXC_BAD_ACCESS”. Can someone help me? :D

    Read the article

  • iPhone: Turning latitude/longitude into "major cross-streets"

    - by Gloria
    Using the MKReverseGeocoder or GoogleAPI or MapKit... Is there a simple way to turn a latitude/longitude into "nearest major cross-streets"? A user might not have any idea where "12345 Pineapple" is located... so I want to show something like "Pineapple and Main"... or (larger, major roads) like "US-140 and Hwy 76". I don't really care what "major" is defined as... perhaps any road with higher speed limits... or more than 3 lanes... etc. I don't really care what "close by" is defines as... perhaps within 0-10 miles... or just "closest found".

    Read the article

  • I need to display users current location as text

    - by Taylor Satula
    Hi, I am new to iPhone development and really have no idea how to do what I am trying to implement. Here is my problem, I need to display the users current street and city as text in my iPhone app (See picture). I have seen many posts on stack overflow and other websites about how to do this but they are all just code examples. As I said before, I am a extreme beginner. I just need to show the MKReverseGeocoder and its output as text in my application. If someone could walk me through how/where to create the ReverseGeocoder and how to make it show up in my application I would be extremely grateful. I have searched for hours trying to find a beginner example but alas I cannot find one that lays it out step by step. I hope this can help me out.

    Read the article

  • ReverseGeoCoder Fail Error in Mapkit

    - by Biranchi
    Hi All, I am making the ReverseGeoCoder request with the following latitude and longitude Latitude = 37.296740 Longitude = -122.001878 I am getting an error as "/SourceCache/ProtocolBuffer/ProtocolBuffer-19/Runtime/PBRequester.m:446 server returned error: 503" With the ReverseGeoCoder fail message as "Error Domain=PBRequesterErrorDomain Code=6001 "Operation could not be completed. (PBRequesterErrorDomain error 6001.)" What is this error due to ?? Any ideas ?? Thanks

    Read the article

  • Storing an subtitle on an annotation with NSUserDefualts

    - by Krismutt
    Hey everybody! Basically: what i try to do is to save the street address of an annotation so that when I quit the application and launch it again the street address still will be there...see the following code: SavePosition.m -(NSString *)subtitle{ if (!subtitle) { return @"Ingen gata i närheten"; } else { return subtitle; } } -(NSString *)title{ return @"Sparad Position"; } -(id)initWithCoordinate:(CLLocationCoordinate2D) coor{ self.coordinate=coor; NSLog(@"%f,%f",coor.latitude,coor.longitude); return self; } - (void)setCoordinate:(CLLocationCoordinate2D)koor { MKReverseGeocoder *geocoder = [[[MKReverseGeocoder alloc] initWithCoordinate:koor] autorelease]; geocoder.delegate = self; coordinate = koor; [geocoder start]; } - (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error { NSLog(@"fail %@", error); } - (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark { self.subtitle = [placemark.addressDictionary valueForKey:@"Street"]; } -(void)applicationWillTerminate:(UIApplication *)application { NSUserDefaults *userDef = [NSUserDefaults standardUserDefaults]; [userDef setValue:subtitle forKey:@"SavedAddress"]; [userDef setBool:YES forKey:@"Street"]; [userDef synchronize]; } @end mainViewController.m -(void)viewDidLoad { [super viewDidLoad]; NSUserDefaults *userDef = [NSUserDefaults standardUserDefaults]; if ([userDef boolForKey:@"sparadKoordinat-existerar"]) { CLLocationCoordinate2D savedCoordinate; savedCoordinate.latitude = [userDef doubleForKey:@"sparadKoordinat-latitud"]; savedCoordinate.longitude = [userDef doubleForKey:@"sparadKoordinat-longitud"]; SparaPosition *position=[[SparaPosition alloc] initWithCoordinate:savedCoordinate]; [mapView addAnnotation:position]; savedPosition = savedCoordinate; raderaSparad.enabled=YES; skickaMaps.enabled=YES; mStoreLocationButton.enabled=NO; friZoom = NO; NSString *savedAddress = [[NSUserDefaults standardUserDefaults] objectForKey:@"SavedAddress"]; if (savedAddress) { savedAddress.subtitle = [userDef valueForKey:@"Street"]; // what code should I add here? } MKCoordinateRegion region; region.center.latitude = savedCoordinate.latitude; region.center.longitude= savedCoordinate.longitude; MKCoordinateSpan span; span.latitudeDelta = 0.01; span.longitudeDelta = 0.01; region.span = span; region = [mapView regionThatFits:region]; [mapView setRegion:region animated:YES]; [mapView setRegion:region animated:TRUE]; }

    Read the article

  • Storing and loading a subtitle of an annotation with NSUserDefualts

    - by Krismutt
    Happy new year everybody! Basically, what I try to do is to save a subtitle to an annotation when the application terminates. When the application starts again I want this stored subtitle to show up in the callout of the annotation again. What am I doing wrong? I just can't get it to work... storeLocation.m - (void)setCoordinate:(CLLocationCoordinate2D)coor { MKReverseGeocoder *geocoder = [[[MKReverseGeocoder alloc] initWithCoordinate:coor] autorelease]; geocoder.delegate = self; coordinate = coor; [geocoder start]; NSUserDefaults *userDef = [NSUserDefaults standardUserDefaults]; [userDef setValue:subtitle forKey:@"SavedAddress"]; [userDef synchronize]; NSLog(@"Sparade adress"); } mainViewController.m -(void)viewDidLoad { NSString *savedAddress = [[NSUserDefaults standardUserDefaults] objectForKey:@"SavedAddress"]; if (savedAddress) { // what code should I add here // so that the subtitle shows up // when the application launches? } } Would really appreciate some help with this one... Thanks in advance!

    Read the article

  • Reason for getting error in Reverse Geocoder Delegate method in the morning times.

    - by Srilakshmi
    - (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error { NSLog(@"reverseGeocoder:%@ didFailWithError:%@", geocoder, error); } This method is getting called in morning times and it is not showing the placemark while running the application in simulator. From Afternoon it is showing the placemark as "Cupertino". Will you give me the reason for not getting the placeMark at morning times?

    Read the article

1