CMRoutingManager problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

CMRoutingManager problem

Michael Gaylord
I am trying to use the CMRoutingManager to draw a route on my map, but I am getting a weird error when the route is received. I have checked by plugging the request into a browser and the response looks correct. Any help would be really appreciated as I don't really want to have to write my own RoutingManager.

Also the Cloudmade Routing example works 100% for me. So I can't really see what the cause is without looking at the CMRoutingManager source, which either is not publicly available or my Google kung-fu is terrible.

The error:

2010-05-02 10:59:31.512 ADO[13452:680b] *** -[NSCFDictionary isEqualToString:]: unrecognized selector sent to instance 0x596caf0
2010-05-02 10:59:31.512 ADO[13452:680b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFDictionary isEqualToString:]: unrecognized selector sent to instance 0x596caf0'
2010-05-02 10:59:31.513 ADO[13452:680b] Stack: (
    807902715,
    2462295305,
    808284155,
    807854166,
    807706786,
    234450,
    810592157,
    810591032,
    2452552217,
    2452551838
)
[Switching to process 13452]
[Switching to process 13452]
Xcode could not locate source file: CMRoutingManager.m (line: 220)

**************************************************************************

//My code looks like the following:

- (void)viewDidLoad {
    [super viewDidLoad];
        .
        .
        .
        //Loading map view and content on screen
        .
        .
        .

       
        self.route = [[[RMPath alloc] initForMap:self.rmMapView] autorelease];
        route.lineColor = [UIColor blueColor];
        route.fillColor = [UIColor clearColor];
        route.lineWidth = 3;
        route.scaleLineWidth = NO;
        TokenManager* tokenManager = [[TokenManager alloc] initWithApikey:@"xxxxxxxxxxxxxxxxxxx"];

        self.routingManager = [[[CMRoutingManager alloc] initWithMapView:rmMapView tokenManager:tokenManager] autorelease];
        routingManager.delegate = self;
}


//Then in my IBAction to display the route
- (IBAction) showDirections:(id)sender {
        id<MapObjectProtocol> mapObject = [((NSMutableDictionary *)selectedMarker.data) objectForKey:@"mapObject"]; //get my object that contains the location data from the marker
        [routingManager findRouteFrom:currentLocation to:mapObject.location onVehicle:CMVehicleCar];
}


	
	
	
	
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CMRoutingManager problem

Dmytro Golub
Hi Michael,

Could you please send me the request to routing service? I will
investigate what happens.

Best regards,
Dmytro

On Sunday, May 2, 2010, Michael Gaylord <[hidden email]> wrote:

>
> I am trying to use the CMRoutingManager to draw a route on my map, but I am
> getting a weird error when the route is received. I have checked by plugging
> the request into a browser and the response looks correct. Any help would be
> really appreciated as I don't really want to have to write my own
> RoutingManager.
>
> Also the Cloudmade Routing example works 100% for me. So I can't really see
> what the cause is without looking at the CMRoutingManager source, which
> either is not publicly available or my Google kung-fu is terrible.
>
> The error:
>
> 2010-05-02 10:59:31.512 ADO[13452:680b] *** -[NSCFDictionary
> isEqualToString:]: unrecognized selector sent to instance 0x596caf0
> 2010-05-02 10:59:31.512 ADO[13452:680b] *** Terminating app due to uncaught
> exception 'NSInvalidArgumentException', reason: '*** -[NSCFDictionary
> isEqualToString:]: unrecognized selector sent to instance 0x596caf0'
> 2010-05-02 10:59:31.513 ADO[13452:680b] Stack: (
>     807902715,
>     2462295305,
>     808284155,
>     807854166,
>     807706786,
>     234450,
>     810592157,
>     810591032,
>     2452552217,
>     2452551838
> )
> [Switching to process 13452]
> [Switching to process 13452]
> Xcode could not locate source file: CMRoutingManager.m (line: 220)
>
> **************************************************************************
>
> //My code looks like the following:
>
> - (void)viewDidLoad {
>     [super viewDidLoad];
>         .
>         .
>         .
>         //Loading map view and content on screen
>         .
>         .
>         .
>
>
>         self.route = [[[RMPath alloc] initForMap:self.rmMapView] autorelease];
>         route.lineColor = [UIColor blueColor];
>         route.fillColor = [UIColor clearColor];
>         route.lineWidth = 3;
>         route.scaleLineWidth = NO;
>         TokenManager* tokenManager = [[TokenManager alloc]
> initWithApikey:@"xxxxxxxxxxxxxxxxxxx"];
>
>         self.routingManager = [[[CMRoutingManager alloc] initWithMapView:rmMapView
> tokenManager:tokenManager] autorelease];
>         routingManager.delegate = self;
> }
>
>
> //Then in my IBAction to display the route
> - (IBAction) showDirections:(id)sender {
>         id<MapObjectProtocol> mapObject = [((NSMutableDictionary
> *)selectedMarker.data) objectForKey:@"mapObject"]; //get my object that
> contains the location data from the marker
>         [routingManager findRouteFrom:currentLocation to:mapObject.location
> onVehicle:CMVehicleCar];
> }
>
> --
> View this message in context: http://gis.638310.n2.nabble.com/CMRoutingManager-problem-tp4992516p4992516.html
> Sent from the Dev -- CloudMade Development mailing list mailing list archive at Nabble.com.
> _______________________________________________
> Dev site list
> [hidden email]
> http://lists.cloudmade.com/listinfo/dev
>
_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev
Loading...