???????????????????????Ч???????????ò??2???iOS?????????????????????а????????????????
????????????Ч?????????????????·???滮??????????????????д??
????·???滮
?????????iOS SDK??????????????????????????????????????·?滮????????????????????????????“????”??“?????”???????????????·?滮??????????????????????????????????á?
???????????????·?淶????????£?
-(void)viewDidLoad
{
//?????????????
_searcher = [[BMKRouteSearch alloc]init];
_searcher.delegate = self;
//???????
BMKPlanNode* start = [[[BMKPlanNode alloc]init] autorelease];
start.name = @"????";
BMKPlanNode* end = [[[BMKPlanNode alloc]init] autorelease];
end.name = "????";
BMKTransitRoutePlanOption *transitRouteSearchOption =         [[BMKTransitRoutePlanOption alloc]init];
transitRouteSearchOption.city= @"??????";
transitRouteSearchOption.startNode = start;
transitRouteSearchOption.endNode = end;
BOOL flag = [_searcher transitSearch:transitRouteSearchOption];
[transitRouteSearchOption release];
if(flag)
{
NSLog(@"bus??????????");
}
else
{
NSLog(@"bus???????????");
}
}
//???Deleage?????????
-(void)onGetTransitRouteResult:(BMKRouteSearch*)searcher result:    (BMKTransitRouteResult*)result
errorCode:(BMKSearchErrorCode)error
{
if (error == BMK_SEARCH_NO_ERROR) {
//?????????????
}
else if (error == BMK_SEARCH_AMBIGUOUS_ROURE_ADDR){
//??·????????????????????????????????
//result.routeAddrResult
}
else {
NSLog(@"?????δ??????");
}
}
//????????delegate????? nil
-(void)viewWillDisappear:(BOOL)animated
{
_searcher.delegate = nil;
}
???????????????????????????????????????????????????????????????