Skip to content

Commit 5b62422

Browse files
committed
_subLocality getting null #16
1 parent 5803dc9 commit 5b62422

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

LMGeocoder.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = 'LMGeocoder'
4-
s.version = '1.0.7'
4+
s.version = '1.0.8'
55
s.summary = 'Simple wrapper for geocoding and reverse geocoding, using both Google Geocoding API and Apple iOS Geocoding Framework.'
66
s.homepage = 'https://github.com/lminhtm/LMGeocoder'
77
s.platform = :ios, '7.0'

LMGeocoder/LMAddress.m

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,15 @@ - (void)setGoogleLocationData:(id)locationData
119119
- (NSString *)component:(NSString *)component inArray:(NSArray *)array ofType:(NSString *)type
120120
{
121121
NSInteger index = [array indexOfObjectPassingTest:^(id obj, NSUInteger idx, BOOL *stop) {
122-
return [(NSString *)([[obj objectForKey:@"types"] firstObject]) isEqualToString:component];
122+
123+
NSArray *types = [obj objectForKey:@"types"];
124+
if (types.count) {
125+
return [types containsObject:component];
126+
}
127+
return NO;
123128
}];
124129

125-
if (index == NSNotFound) {
126-
return nil;
127-
}
128-
129-
if (index >= array.count) {
130+
if (index == NSNotFound || index >= array.count) {
130131
return nil;
131132
}
132133

LMGeocoderDemo/LMGeocoder/LMGeocoder-Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.0.4</string>
20+
<string>1.0.8</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>10</string>
24+
<string>100</string>
2525
<key>LSRequiresIPhoneOS</key>
2626
<true/>
2727
<key>NSAppTransportSecurity</key>

0 commit comments

Comments
 (0)