How to extract street, city, etc. from GMSPlace Address Components

后端 未结 10 1862
栀梦
栀梦 2021-02-20 02:51

I\'m using Google Places API for iOS and can successfully retrieve nearby places and present the address as a string. What I\'m trying to do is extract address components such

10条回答
  •  故里飘歌
    2021-02-20 03:37

    I could not find this anywhere for Objective-C, for those who follow behind me:

    for (int i = 0; i < [place.addressComponents count]; i++)
    {
        NSLog(@"name %@ = type %@", place.addressComponents[i].name, place.addressComponents[i].type);
    }
    

提交回复
热议问题