Re: [問題] 座標轉地址

看板MacDev作者 (派斯麵)時間12年前 (2012/11/01 02:20), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《winnie1103 (Winnie)》之銘言: : 想請問一下以下兩個問題 : 第一 : 如果我已經使用CLLocation抓取到座標 : 那要怎麼讓座標轉地址? : 我不需要地圖來顯示 : 只需要抓到一整串地址就可以了 最近剛好寫到.. - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { CLGeocoder* geoCoder= [[CLGeocoder alloc]init]; [geoCoder reverseGeocodeLocation:newLocation completionHandler: ^(NSArray *placemarks, NSError *error) { CLPlacemark *placemark = [placemarks objectAtIndex:0]; //修正, from http://ikevin.tw/333#more-333 //uranusjr 大大的這招比較好用(只需整組地址的話) //取得地址字串 NSString *locatedAt = [[placemark.addressDictionary valueForKey:@"FormattedAddressLines"] componentsJoinedByString:@", "]; }]; } : 第二 : 在Xcode裡如何讓字串去做比較 : 並在寫好的PickerView中 : 自動選取對應的值? : Ex:抓取到的值為-Blue : 即自動選定PickerView中的Blue選項 : 並且顯示在對應的位置上(Label等) : 謝謝!!! 一年多前有寫過 印象中是要自己比對並捲到該值 不知道是否有新作法 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.42.63.190 ※ 編輯: Piceman 來自: 114.42.50.204 (11/01 15:28) ※ 編輯: Piceman 來自: 114.42.50.204 (11/01 23:28) ※ 編輯: Piceman 來自: 114.42.50.204 (11/01 23:29)
文章代碼(AID): #1GaMlG-d (MacDev)
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
文章代碼(AID): #1GaMlG-d (MacDev)