File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
CoreLocationSample-Geocoding
CoreLocationSample-Geocoding Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,8 @@ - (void)viewDidUnload
53
53
[super viewDidUnload ];
54
54
}
55
55
56
- - (void )dealloc {
56
+ - (void )dealloc
57
+ {
57
58
[_geocoder release ];
58
59
[_addressesArray release ];
59
60
@@ -122,7 +123,7 @@ - (IBAction)searchPlaceName:(id)sender {
122
123
}
123
124
124
125
- (IBAction )convertCoordinate : (id )sender {
125
- // 緯度が正しいかをチェック
126
+ // 緯度・経度が正しいかをチェック
126
127
if (![self coordinateIsValid ]) {
127
128
return ; // エラーがあれば変換しない
128
129
}
@@ -177,7 +178,7 @@ - (BOOL)placeNameIsValid
177
178
}
178
179
179
180
/* 入力されている値が、正しい緯度・経度であるかを判定
180
- * CLLocationCoordinate2DIsValid だと、緯度か経度のどちらが誤っているか検知できない
181
+ * CLLocationCoordinate2DIsValid だと、緯度か経度のどちらが誤っているかを検知できない
181
182
*/
182
183
- (BOOL )coordinateIsValid
183
184
{
@@ -263,7 +264,7 @@ - (NSString *)errorToString:(NSError *)error
263
264
case kCLErrorGeocodeCanceled :
264
265
return @" Canceled" ;
265
266
default :
266
- return [error description ];
267
+ return [error localizedDescription ];
267
268
}
268
269
}
269
270
Original file line number Diff line number Diff line change 1
1
CLGeocoderを利用したジオコーディングのため、iOS 5.0以降でのみ動作します。
2
2
MKReverseGeocoderを利用したジオコーディングの出力にはGoogleマップを利用しなければならないため、
3
3
以下のURLでサンプルを公開しています。
4
-
5
- https://github.com/uqtimes/iOS-SampleCodes/CoreLocationSample-MKReverseGeocoder
4
+ https://github.com/uqtimes/iOS-SampleCodes/tree/master/CoreLocationSample-MKReverseGeocoder
You can’t perform that action at this time.
0 commit comments