首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏冰霜之地

    iOS如何优雅的处理“回调地狱Callback hell”(一)——使用PromiseKit

    MKLocalSearchResponse *response, NSError *error){ if (++x == 2) { [self finish]; } }; [[[MKLocalSearch alloc] initWithRequest:rq1] startWithCompletionHandler:completionHandler]; [[[MKLocalSearch alloc] initWithRequest :rq2] startWithCompletionHandler:completionHandler];复制代码 这里就可以使用when来优雅的处理这种情况: id search1 = [[[MKLocalSearch alloc] initWithRequest:rq1] promise]; id search2 = [[[MKLocalSearch alloc] initWithRequest:rq2] promise id coffeeSearch = [[MKLocalSearch alloc] initWithRequest:rq1]; id beerSearch = [[MKLocalSearch alloc]

    4.5K51发布于 2018-08-30
  • 来自专栏一“技”之长

    iOS原生地图开发进阶——使用导航和附近兴趣点检索

    //设置检索参数     req.region=region;     //兴趣点关键字     req.naturalLanguageQuery=@"hotal";     //初始化检索     MKLocalSearch  * ser = [[MKLocalSearch alloc]initWithRequest:req];     //开始检索,结果返回在block中     [ser startWithCompletionHandler

    1.3K40发布于 2018-08-16
领券