anytime_is_sunlight 2015-01-06 11:01 采纳率: 100%
浏览 1130

高德地图关键字搜索真机调试

高德地图搜索,模拟器上面能进搜索代理,返回搜索结果,
但是在真机上面就不进搜索代理,所以就没有返回搜索结果,
这是什么原因,

设置搜索的代码;

_searchMapView = [[AMapSearchAPI alloc] initWithSearchKey:[MAMapServices sharedServices].apiKey Delegate:self];
AMapInputTipsSearchRequest *tipsRequest= [[AMapInputTipsSearchRequest alloc] init];
tipsRequest.keywords = searchKeyWord;
tipsRequest.searchType = AMapSearchType_InputTips;
tipsRequest.city = @[@"北京"];
if ([kCurentLanguage isEqualToString:@"en"]) {
_searchMapView.language = AMapSearchLanguage_en;
}
else if ([kCurentLanguage isEqualToString:@"zh-Hans"]) {
_searchMapView.language = AMapSearchLanguage_zh_CN;
}
//发起输入提示搜索
[_searchMapView AMapInputTipsSearch: tipsRequest];


 实现搜索结果的回调:

 //实现输入提示的回调函数
-(void)onInputTipsSearchDone:(AMapInputTipsSearchRequest*)request response:(AMapInputTipsSearchResponse *)response
{
    if(response.tips.count == 0) {
        return;
    }
    else {
        if (_selecedIndex == 0) {
            _addAttractionsDataArray = [self resultArray:response.tips];
            [_acttractionsTableView reloadData];
        }
        else if (_selecedIndex == 1) {
            _addStayDataArray = [self resultArray:response.tips];
            [_stayTableView reloadData];
        }
        else if (_selecedIndex == 2) {
            _addEatDataArray = [self resultArray:response.tips];
            [_eatTableView reloadData];
        }
    }
}

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 腾讯企业邮箱邮件可以恢复么
    • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
    • ¥15 错误 LNK2001 无法解析的外部符号
    • ¥50 安装pyaudiokits失败
    • ¥15 计组这些题应该咋做呀
    • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
    • ¥15 让node服务器有自动加载文件的功能
    • ¥15 jmeter脚本回放有的是对的有的是错的
    • ¥15 r语言蛋白组学相关问题
    • ¥15 Python时间序列如何拟合疏系数模型