2015-10-26 72 views

回答

0

內,您的- (無效)textFieldDidBeginEditing:(*的UITextField)文本框的的UITextField委託方法方法,寫出下面的代碼: -

GMSPlacesClient *placesClient= [[GMSPlacesClient alloc] init]; 

[placesClient autocompleteQuery:textField.text bounds:nil 
               filter:kGMSPlacesAutocompleteTypeFilterNoFilter 
             callback:^(NSArray *results, NSError *error) { 
              if (error != nil) { 
               NSLog(@"Autocomplete error %@", [error localizedDescription]); 
               return; 
              } 

              for (GMSAutocompletePrediction* result in results) { 

               NSLog(@"Result '%@' with placeID %@", result.attributedFullText.string, result.placeID); 
              } 
             }]; 
+0

我收到錯誤前兩行 –

+0

有你進口GoogleMa ps頭文件? –