From 8820afd2209252f7fe6f6d2abf4318165de92bcc Mon Sep 17 00:00:00 2001 From: Andrea Mazzini Date: Thu, 15 May 2014 18:27:11 +0200 Subject: [PATCH 1/8] Fixed coordinate inclusion in query method --- .../SPGooglePlacesAutocompleteQuery.h | 2 +- .../SPGooglePlacesAutocompleteQuery.m | 6 +++--- .../SPGooglePlacesAutocompleteViewController.m | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.h b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.h index 6684fc3..c7477b1 100644 --- a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.h +++ b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.h @@ -53,7 +53,7 @@ /*! The point around which you wish to retrieve Place information. */ -@property (nonatomic) CLLocationCoordinate2D location; +@property (nonatomic, strong) CLLocation *location; /*! The distance (in meters) within which to return Place results. Note that setting a radius biases results to the indicated area, but may not fully restrict results to the specified area. diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.m b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.m index 2faf0f1..71d212e 100644 --- a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.m +++ b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.m @@ -28,7 +28,7 @@ - (id)init { self.sensor = YES; self.key = kGoogleAPIKey; self.offset = NSNotFound; - self.location = CLLocationCoordinate2DMake(-1, -1); + self.location = nil; self.radius = NSNotFound; self.types = -1; } @@ -55,8 +55,8 @@ - (NSString *)googleURLString { if (offset != NSNotFound) { [url appendFormat:@"&offset=%u", offset]; } - if (location.latitude != -1) { - [url appendFormat:@"&location=%f,%f", location.latitude, location.longitude]; + if (self.location) { + [url appendFormat:@"&location=%f,%f", self.location.coordinate.latitude, self.location.coordinate.longitude]; } if (radius != NSNotFound) { [url appendFormat:@"&radius=%f", radius]; diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteViewController.m b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteViewController.m index d959b89..1441662 100644 --- a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteViewController.m +++ b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteViewController.m @@ -135,7 +135,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath #pragma mark UISearchDisplayDelegate - (void)handleSearchForSearchString:(NSString *)searchString { - searchQuery.location = self.mapView.userLocation.coordinate; + searchQuery.location = self.mapView.userLocation.location; searchQuery.input = searchString; [searchQuery fetchPlaces:^(NSArray *places, NSError *error) { if (error) { From ee4916b1925d72193fbb363a7b2b815045efb49c Mon Sep 17 00:00:00 2001 From: Andrea Mazzini Date: Thu, 15 May 2014 18:31:05 +0200 Subject: [PATCH 2/8] Added podspec --- SPGooglePlacesAutocomplete.podspec | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 SPGooglePlacesAutocomplete.podspec diff --git a/SPGooglePlacesAutocomplete.podspec b/SPGooglePlacesAutocomplete.podspec new file mode 100644 index 0000000..30597ce --- /dev/null +++ b/SPGooglePlacesAutocomplete.podspec @@ -0,0 +1,21 @@ +Pod::Spec.new do |s| + s.name = "SPGooglePlacesAutocomplete" + s.version = "1.0.2" + s.summary = "An objective-c wrapper around the Google Places autocomplete API. Includes sample application emulating the Maps app." + s.description = <<-DESC + SPGooglePlacesAutocomplete is a simple objective-c wrapper around the Google Places Autocomplete API. + + The API can be used to provide autocomplete functionality for text-based geographic searches, by returning Places such as businesses, addresses, and points of interest as a user types. + SPGooglePlacesAutocomplete also provides support for converting Place results into CLPlacemark objects for easy mapping with MKMapView. + A longer description of dumy in Markdown format. + DESC + s.homepage = "https://github.com/chrischentickbox/SPGooglePlacesAutocomplete" + s.license = { :type => 'MIT', :file => 'LICENSE' } + s.authors = { "Matej Bukovinski" => "matej@bukovinski.com", "Chris Chen" => "chrischen79@gmail.com" } + + s.platform = :ios, '6.0' + s.source = { :git => "https://github.com/chrischentickbox/SPGooglePlacesAutocomplete.git", :tag => '1.0.2'} + s.source_files = 'SPGooglePlacesAutocomplete/*.{h,m}' + s.frameworks = 'CoreLocation' + s.requires_arc = true +end From 4861abe6a91278813ea80008f70ec01c46bb0e2a Mon Sep 17 00:00:00 2001 From: Andrea Mazzini Date: Thu, 15 May 2014 18:33:29 +0200 Subject: [PATCH 3/8] Fixed podspec --- SPGooglePlacesAutocomplete.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPGooglePlacesAutocomplete.podspec b/SPGooglePlacesAutocomplete.podspec index 30597ce..e191398 100644 --- a/SPGooglePlacesAutocomplete.podspec +++ b/SPGooglePlacesAutocomplete.podspec @@ -17,5 +17,5 @@ Pod::Spec.new do |s| s.source = { :git => "https://github.com/chrischentickbox/SPGooglePlacesAutocomplete.git", :tag => '1.0.2'} s.source_files = 'SPGooglePlacesAutocomplete/*.{h,m}' s.frameworks = 'CoreLocation' - s.requires_arc = true + s.requires_arc = false end From d6456b6f1ced5e39c0f29b50532f932561ff59c8 Mon Sep 17 00:00:00 2001 From: Andrea Mazzini Date: Thu, 15 May 2014 18:40:18 +0200 Subject: [PATCH 4/8] Moved to ARC --- .../project.pbxproj | 10 +++-- .../contents.xcworkspacedata | 7 ++++ .../SPGooglePlacesAutocomplete.xccheckout | 41 +++++++++++++++++++ SPGooglePlacesAutocomplete/AppDelegate.m | 8 +--- .../SPGooglePlacesAutocompletePlace.h | 6 +-- .../SPGooglePlacesAutocompletePlace.m | 15 ++----- .../SPGooglePlacesAutocompleteQuery.h | 6 +-- .../SPGooglePlacesAutocompleteQuery.m | 12 +----- .../SPGooglePlacesAutocompleteUtilities.m | 2 - ...SPGooglePlacesAutocompleteViewController.h | 2 +- ...SPGooglePlacesAutocompleteViewController.m | 14 ++----- .../SPGooglePlacesPlaceDetailQuery.h | 6 +-- .../SPGooglePlacesPlaceDetailQuery.m | 12 +----- 13 files changed, 76 insertions(+), 65 deletions(-) create mode 100644 SPGooglePlacesAutocomplete.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 SPGooglePlacesAutocomplete.xcodeproj/project.xcworkspace/xcshareddata/SPGooglePlacesAutocomplete.xccheckout diff --git a/SPGooglePlacesAutocomplete.xcodeproj/project.pbxproj b/SPGooglePlacesAutocomplete.xcodeproj/project.pbxproj index 1a2e66f..e41fd93 100644 --- a/SPGooglePlacesAutocomplete.xcodeproj/project.pbxproj +++ b/SPGooglePlacesAutocomplete.xcodeproj/project.pbxproj @@ -172,7 +172,7 @@ 9C4A631415B64A3F00E15FBA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0450; + LastUpgradeCheck = 0510; ORGANIZATIONNAME = "Stephen Poletto"; }; buildConfigurationList = 9C4A631715B64A3F00E15FBA /* Build configuration list for PBXProject "SPGooglePlacesAutocomplete" */; @@ -244,7 +244,7 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; @@ -258,6 +258,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 6.0; + ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; }; name = Debug; @@ -269,7 +270,7 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -285,6 +286,7 @@ 9C4A633615B64A3F00E15FBA /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SPGooglePlacesAutocomplete/SPGooglePlacesAutocomplete-Prefix.pch"; INFOPLIST_FILE = "SPGooglePlacesAutocomplete/SPGooglePlacesAutocomplete-Info.plist"; @@ -297,6 +299,7 @@ 9C4A633715B64A3F00E15FBA /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SPGooglePlacesAutocomplete/SPGooglePlacesAutocomplete-Prefix.pch"; INFOPLIST_FILE = "SPGooglePlacesAutocomplete/SPGooglePlacesAutocomplete-Info.plist"; @@ -325,6 +328,7 @@ 9C4A633715B64A3F00E15FBA /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/SPGooglePlacesAutocomplete.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SPGooglePlacesAutocomplete.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..09df3f9 --- /dev/null +++ b/SPGooglePlacesAutocomplete.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SPGooglePlacesAutocomplete.xcodeproj/project.xcworkspace/xcshareddata/SPGooglePlacesAutocomplete.xccheckout b/SPGooglePlacesAutocomplete.xcodeproj/project.xcworkspace/xcshareddata/SPGooglePlacesAutocomplete.xccheckout new file mode 100644 index 0000000..f8e91ad --- /dev/null +++ b/SPGooglePlacesAutocomplete.xcodeproj/project.xcworkspace/xcshareddata/SPGooglePlacesAutocomplete.xccheckout @@ -0,0 +1,41 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + F6D49258-0A05-4B63-8500-D726ED7022A7 + IDESourceControlProjectName + SPGooglePlacesAutocomplete + IDESourceControlProjectOriginsDictionary + + 8EC61E37-3D49-4761-8768-42F8B7792DC4 + ssh://github.com/andreamazz/SPGooglePlacesAutocomplete.git + + IDESourceControlProjectPath + SPGooglePlacesAutocomplete.xcodeproj/project.xcworkspace + IDESourceControlProjectRelativeInstallPathDictionary + + 8EC61E37-3D49-4761-8768-42F8B7792DC4 + ../.. + + IDESourceControlProjectURL + ssh://github.com/andreamazz/SPGooglePlacesAutocomplete.git + IDESourceControlProjectVersion + 110 + IDESourceControlProjectWCCIdentifier + 8EC61E37-3D49-4761-8768-42F8B7792DC4 + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + 8EC61E37-3D49-4761-8768-42F8B7792DC4 + IDESourceControlWCCName + SPGooglePlacesAutocomplete + + + + diff --git a/SPGooglePlacesAutocomplete/AppDelegate.m b/SPGooglePlacesAutocomplete/AppDelegate.m index dd1f14a..d987749 100644 --- a/SPGooglePlacesAutocomplete/AppDelegate.m +++ b/SPGooglePlacesAutocomplete/AppDelegate.m @@ -14,18 +14,14 @@ @implementation AppDelegate @synthesize window; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - SPGooglePlacesAutocompleteViewController *viewController = [[[SPGooglePlacesAutocompleteViewController alloc] init] autorelease]; + SPGooglePlacesAutocompleteViewController *viewController = [[SPGooglePlacesAutocompleteViewController alloc] init]; self.window.rootViewController = viewController; [self.window makeKeyAndVisible]; return YES; } -- (void)dealloc { - [window release]; - [super dealloc]; -} @end diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompletePlace.h b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompletePlace.h index 799b6dd..6322dbe 100644 --- a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompletePlace.h +++ b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompletePlace.h @@ -19,7 +19,7 @@ /*! Contains the human-readable name for the returned result. For establishment results, this is usually the business name. */ -@property (nonatomic, retain, readonly) NSString *name; +@property (nonatomic, strong, readonly) NSString *name; /*! Contains the primary 'type' of this place (i.e. "establishment" or "gecode"). @@ -29,12 +29,12 @@ /*! Contains a unique token that you can use to retrieve additional information about this place in a Place Details request. You can store this token and use it at any time in future to refresh cached data about this Place, but the same token is not guaranteed to be returned for any given Place across different searches. */ -@property (nonatomic, retain, readonly) NSString *reference; +@property (nonatomic, strong, readonly) NSString *reference; /*! Contains a unique stable identifier denoting this place. This identifier may not be used to retrieve information about this place, but can be used to consolidate data about this Place, and to verify the identity of a Place across separate searches. */ -@property (nonatomic, retain, readonly) NSString *identifier; +@property (nonatomic, strong, readonly) NSString *identifier; /*! Resolves the place to a CLPlacemark, issuing Google Place Details request if needed. diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompletePlace.m b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompletePlace.m index bf8e434..d29e535 100644 --- a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompletePlace.m +++ b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompletePlace.m @@ -10,9 +10,9 @@ #import "SPGooglePlacesPlaceDetailQuery.h" @interface SPGooglePlacesAutocompletePlace() -@property (nonatomic, retain, readwrite) NSString *name; -@property (nonatomic, retain, readwrite) NSString *reference; -@property (nonatomic, retain, readwrite) NSString *identifier; +@property (nonatomic, strong, readwrite) NSString *name; +@property (nonatomic, strong, readwrite) NSString *reference; +@property (nonatomic, strong, readwrite) NSString *identifier; @property (nonatomic, readwrite) SPGooglePlacesAutocompletePlaceType type; @end @@ -21,7 +21,7 @@ @implementation SPGooglePlacesAutocompletePlace @synthesize name, reference, identifier, type; + (SPGooglePlacesAutocompletePlace *)placeFromDictionary:(NSDictionary *)placeDictionary { - SPGooglePlacesAutocompletePlace *place = [[[self alloc] init] autorelease]; + SPGooglePlacesAutocompletePlace *place = [[self alloc] init]; place.name = [placeDictionary objectForKey:@"description"]; place.reference = [placeDictionary objectForKey:@"reference"]; place.identifier = [placeDictionary objectForKey:@"id"]; @@ -81,12 +81,5 @@ - (void)resolveToPlacemark:(SPGooglePlacesPlacemarkResultBlock)block { } } -- (void)dealloc { - [name release]; - [reference release]; - [identifier release]; - [geocoder release]; - [super dealloc]; -} @end diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.h b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.h index c7477b1..dc0b91e 100644 --- a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.h +++ b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.h @@ -30,7 +30,7 @@ /*! The text string on which to search. The Place service will return candidate matches based on this string and order results based on their perceived relevance. Defaults to nil. */ -@property (nonatomic, retain) NSString *input; +@property (nonatomic, strong) NSString *input; /*! Indicates whether or not the Place request came from a device using a location sensor (e.g. a GPS) to determine the location sent in this request. This value must be either true or false. Defaults to YES. @@ -40,7 +40,7 @@ /*! Your application's API key. This key identifies your application for purposes of quota management. Visit the APIs Console to select an API Project and obtain your key. Maps API for Business customers must use the API project created for them as part of their Places for Business purchase. Defaults to kGoogleAPIKey. */ -@property (nonatomic, retain) NSString *key; +@property (nonatomic, strong) NSString *key; #pragma mark - #pragma mark Optional parameters @@ -63,7 +63,7 @@ /*! The language in which to return results. See the supported list of domain languages. Note that we often update supported languages so this list may not be exhaustive. If language is not supplied, the Place service will attempt to use the native language of the domain from which the request is sent. */ -@property (nonatomic, retain) NSString *language; +@property (nonatomic, strong) NSString *language; /*! The types of Place results to return. If no type is specified, all types will be returned. diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.m b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.m index 71d212e..90ad468 100644 --- a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.m +++ b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.m @@ -18,7 +18,7 @@ @implementation SPGooglePlacesAutocompleteQuery @synthesize input, sensor, key, offset, location, radius, language, types, resultBlock; + (SPGooglePlacesAutocompleteQuery *)query { - return [[[self alloc] init] autorelease]; + return [[self alloc] init]; } - (id)init { @@ -39,14 +39,6 @@ - (NSString *)description { return [NSString stringWithFormat:@"Query URL: %@", [self googleURLString]]; } -- (void)dealloc { - [googleConnection release]; - [responseData release]; - [input release]; - [key release]; - [language release]; - [super dealloc]; -} - (NSString *)googleURLString { NSMutableString *url = [NSMutableString stringWithFormat:@"https://maps.googleapis.com/maps/api/place/autocomplete/json?input=%@&sensor=%@&key=%@", @@ -71,8 +63,6 @@ - (NSString *)googleURLString { } - (void)cleanup { - [googleConnection release]; - [responseData release]; googleConnection = nil; responseData = nil; self.resultBlock = nil; diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteUtilities.m b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteUtilities.m index 894e743..7335ff2 100644 --- a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteUtilities.m +++ b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteUtilities.m @@ -32,7 +32,6 @@ BOOL SPEnsureGoogleAPIKey() { userHasProvidedAPIKey = NO; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"API Key Needed" message:@"Please replace kGoogleAPIKey with your Google API key." delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil]; [alert show]; - [alert release]; } return userHasProvidedAPIKey; } @@ -40,7 +39,6 @@ BOOL SPEnsureGoogleAPIKey() { void SPPresentAlertViewWithErrorAndTitle(NSError *error, NSString *title) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:[error localizedDescription] delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil]; [alert show]; - [alert release]; } extern BOOL SPIsEmptyString(NSString *string) { diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteViewController.h b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteViewController.h index ec72b67..04f1797 100644 --- a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteViewController.h +++ b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteViewController.h @@ -18,6 +18,6 @@ BOOL shouldBeginEditing; } -@property (retain, nonatomic) IBOutlet MKMapView *mapView; +@property (strong, nonatomic) IBOutlet MKMapView *mapView; @end diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteViewController.m b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteViewController.m index 1441662..9022128 100644 --- a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteViewController.m +++ b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteViewController.m @@ -36,12 +36,6 @@ - (void)viewDidUnload { [super viewDidUnload]; } -- (void)dealloc { - [selectedPlaceAnnotation release]; - [mapView release]; - [searchQuery release]; - [super dealloc]; -} - (IBAction)recenterMapToUserLocation:(id)sender { MKCoordinateRegion region; @@ -71,7 +65,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N static NSString *cellIdentifier = @"SPGooglePlacesAutocompleteCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; if (!cell) { - cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease]; + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; } cell.textLabel.font = [UIFont fontWithName:@"GillSans" size:16.0]; @@ -97,7 +91,6 @@ - (void)recenterMapToPlacemark:(CLPlacemark *)placemark { - (void)addPlacemarkAnnotationToMap:(CLPlacemark *)placemark addressString:(NSString *)address { [self.mapView removeAnnotation:selectedPlaceAnnotation]; - [selectedPlaceAnnotation release]; selectedPlaceAnnotation = [[MKPointAnnotation alloc] init]; selectedPlaceAnnotation.coordinate = placemark.location.coordinate; @@ -141,8 +134,7 @@ - (void)handleSearchForSearchString:(NSString *)searchString { if (error) { SPPresentAlertViewWithErrorAndTitle(error, @"Could not fetch Places"); } else { - [searchResultPlaces release]; - searchResultPlaces = [places retain]; + searchResultPlaces = places; [self.searchDisplayController.searchResultsTableView reloadData]; } }]; @@ -193,7 +185,7 @@ - (MKAnnotationView *)mapView:(MKMapView *)mapViewIn viewForAnnotation:(id Date: Thu, 15 May 2014 18:41:50 +0200 Subject: [PATCH 5/8] Reorganized sources --- .../SPGooglePlacesAutocomplete-Prefix.pch | 0 .../SPGooglePlacesAutocompletePlace.h | 0 .../SPGooglePlacesAutocompletePlace.m | 0 .../SPGooglePlacesAutocompleteQuery.h | 0 .../SPGooglePlacesAutocompleteQuery.m | 0 .../SPGooglePlacesAutocompleteUtilities.h | 0 .../SPGooglePlacesAutocompleteUtilities.m | 0 ...SPGooglePlacesAutocompleteViewController.h | 0 ...SPGooglePlacesAutocompleteViewController.m | 0 .../SPGooglePlacesPlaceDetailQuery.h | 0 .../SPGooglePlacesPlaceDetailQuery.m | 0 .../project.pbxproj | 70 +++++++++++-------- 12 files changed, 40 insertions(+), 30 deletions(-) rename {SPGooglePlacesAutocomplete => Library}/SPGooglePlacesAutocomplete-Prefix.pch (100%) rename {SPGooglePlacesAutocomplete => Library}/SPGooglePlacesAutocompletePlace.h (100%) rename {SPGooglePlacesAutocomplete => Library}/SPGooglePlacesAutocompletePlace.m (100%) rename {SPGooglePlacesAutocomplete => Library}/SPGooglePlacesAutocompleteQuery.h (100%) rename {SPGooglePlacesAutocomplete => Library}/SPGooglePlacesAutocompleteQuery.m (100%) rename {SPGooglePlacesAutocomplete => Library}/SPGooglePlacesAutocompleteUtilities.h (100%) rename {SPGooglePlacesAutocomplete => Library}/SPGooglePlacesAutocompleteUtilities.m (100%) rename {SPGooglePlacesAutocomplete => Library}/SPGooglePlacesAutocompleteViewController.h (100%) rename {SPGooglePlacesAutocomplete => Library}/SPGooglePlacesAutocompleteViewController.m (100%) rename {SPGooglePlacesAutocomplete => Library}/SPGooglePlacesPlaceDetailQuery.h (100%) rename {SPGooglePlacesAutocomplete => Library}/SPGooglePlacesPlaceDetailQuery.m (100%) diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocomplete-Prefix.pch b/Library/SPGooglePlacesAutocomplete-Prefix.pch similarity index 100% rename from SPGooglePlacesAutocomplete/SPGooglePlacesAutocomplete-Prefix.pch rename to Library/SPGooglePlacesAutocomplete-Prefix.pch diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompletePlace.h b/Library/SPGooglePlacesAutocompletePlace.h similarity index 100% rename from SPGooglePlacesAutocomplete/SPGooglePlacesAutocompletePlace.h rename to Library/SPGooglePlacesAutocompletePlace.h diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompletePlace.m b/Library/SPGooglePlacesAutocompletePlace.m similarity index 100% rename from SPGooglePlacesAutocomplete/SPGooglePlacesAutocompletePlace.m rename to Library/SPGooglePlacesAutocompletePlace.m diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.h b/Library/SPGooglePlacesAutocompleteQuery.h similarity index 100% rename from SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.h rename to Library/SPGooglePlacesAutocompleteQuery.h diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.m b/Library/SPGooglePlacesAutocompleteQuery.m similarity index 100% rename from SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteQuery.m rename to Library/SPGooglePlacesAutocompleteQuery.m diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteUtilities.h b/Library/SPGooglePlacesAutocompleteUtilities.h similarity index 100% rename from SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteUtilities.h rename to Library/SPGooglePlacesAutocompleteUtilities.h diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteUtilities.m b/Library/SPGooglePlacesAutocompleteUtilities.m similarity index 100% rename from SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteUtilities.m rename to Library/SPGooglePlacesAutocompleteUtilities.m diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteViewController.h b/Library/SPGooglePlacesAutocompleteViewController.h similarity index 100% rename from SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteViewController.h rename to Library/SPGooglePlacesAutocompleteViewController.h diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteViewController.m b/Library/SPGooglePlacesAutocompleteViewController.m similarity index 100% rename from SPGooglePlacesAutocomplete/SPGooglePlacesAutocompleteViewController.m rename to Library/SPGooglePlacesAutocompleteViewController.m diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesPlaceDetailQuery.h b/Library/SPGooglePlacesPlaceDetailQuery.h similarity index 100% rename from SPGooglePlacesAutocomplete/SPGooglePlacesPlaceDetailQuery.h rename to Library/SPGooglePlacesPlaceDetailQuery.h diff --git a/SPGooglePlacesAutocomplete/SPGooglePlacesPlaceDetailQuery.m b/Library/SPGooglePlacesPlaceDetailQuery.m similarity index 100% rename from SPGooglePlacesAutocomplete/SPGooglePlacesPlaceDetailQuery.m rename to Library/SPGooglePlacesPlaceDetailQuery.m diff --git a/SPGooglePlacesAutocomplete.xcodeproj/project.pbxproj b/SPGooglePlacesAutocomplete.xcodeproj/project.pbxproj index e41fd93..f23401f 100644 --- a/SPGooglePlacesAutocomplete.xcodeproj/project.pbxproj +++ b/SPGooglePlacesAutocomplete.xcodeproj/project.pbxproj @@ -7,27 +7,38 @@ objects = { /* Begin PBXBuildFile section */ + 65D5BBD7192525BD0014596B /* SPGooglePlacesAutocompletePlace.m in Sources */ = {isa = PBXBuildFile; fileRef = 65D5BBCE192525BD0014596B /* SPGooglePlacesAutocompletePlace.m */; }; + 65D5BBD8192525BD0014596B /* SPGooglePlacesAutocompleteQuery.m in Sources */ = {isa = PBXBuildFile; fileRef = 65D5BBD0192525BD0014596B /* SPGooglePlacesAutocompleteQuery.m */; }; + 65D5BBD9192525BD0014596B /* SPGooglePlacesAutocompleteUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 65D5BBD2192525BD0014596B /* SPGooglePlacesAutocompleteUtilities.m */; }; + 65D5BBDA192525BD0014596B /* SPGooglePlacesAutocompleteViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 65D5BBD4192525BD0014596B /* SPGooglePlacesAutocompleteViewController.m */; }; + 65D5BBDB192525BD0014596B /* SPGooglePlacesPlaceDetailQuery.m in Sources */ = {isa = PBXBuildFile; fileRef = 65D5BBD6192525BD0014596B /* SPGooglePlacesPlaceDetailQuery.m */; }; 9C4A632215B64A3F00E15FBA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C4A632115B64A3F00E15FBA /* UIKit.framework */; }; 9C4A632415B64A3F00E15FBA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C4A632315B64A3F00E15FBA /* Foundation.framework */; }; 9C4A632615B64A3F00E15FBA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C4A632515B64A3F00E15FBA /* CoreGraphics.framework */; }; 9C4A632C15B64A3F00E15FBA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9C4A632A15B64A3F00E15FBA /* InfoPlist.strings */; }; 9C4A632E15B64A3F00E15FBA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C4A632D15B64A3F00E15FBA /* main.m */; }; 9C4A633215B64A3F00E15FBA /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C4A633115B64A3F00E15FBA /* AppDelegate.m */; }; - 9C4A633A15B64AF700E15FBA /* SPGooglePlacesAutocompleteQuery.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C4A633915B64AF700E15FBA /* SPGooglePlacesAutocompleteQuery.m */; }; 9C4A633C15B64C9200E15FBA /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C4A633B15B64C9200E15FBA /* CoreLocation.framework */; }; - 9C4A633F15B64FA400E15FBA /* SPGooglePlacesAutocompletePlace.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C4A633E15B64FA400E15FBA /* SPGooglePlacesAutocompletePlace.m */; }; - 9C4A634715B6950C00E15FBA /* SPGooglePlacesAutocompleteViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C4A634515B6950B00E15FBA /* SPGooglePlacesAutocompleteViewController.m */; }; 9C4A634815B6950C00E15FBA /* SPGooglePlacesAutocompleteViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9C4A634615B6950B00E15FBA /* SPGooglePlacesAutocompleteViewController.xib */; }; 9C4A634A15B695FA00E15FBA /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C4A634915B695FA00E15FBA /* MapKit.framework */; }; - 9C4A63A015B6A4FB00E15FBA /* SPGooglePlacesAutocompleteUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C4A639F15B6A4FB00E15FBA /* SPGooglePlacesAutocompleteUtilities.m */; }; 9C4A63A615B6C01100E15FBA /* location.png in Resources */ = {isa = PBXBuildFile; fileRef = 9C4A63A415B6C01100E15FBA /* location.png */; }; 9C4A63A715B6C01100E15FBA /* location@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9C4A63A515B6C01100E15FBA /* location@2x.png */; }; 9C4A63AE15B6C0DB00E15FBA /* locateButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 9C4A63AC15B6C0DB00E15FBA /* locateButton.png */; }; 9C4A63AF15B6C0DB00E15FBA /* locateButton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9C4A63AD15B6C0DB00E15FBA /* locateButton@2x.png */; }; - 9C4A63B215B73EA300E15FBA /* SPGooglePlacesPlaceDetailQuery.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C4A63B115B73EA200E15FBA /* SPGooglePlacesPlaceDetailQuery.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 65D5BBCC192525BD0014596B /* SPGooglePlacesAutocomplete-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "SPGooglePlacesAutocomplete-Prefix.pch"; sourceTree = ""; }; + 65D5BBCD192525BD0014596B /* SPGooglePlacesAutocompletePlace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPGooglePlacesAutocompletePlace.h; sourceTree = ""; }; + 65D5BBCE192525BD0014596B /* SPGooglePlacesAutocompletePlace.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPGooglePlacesAutocompletePlace.m; sourceTree = ""; }; + 65D5BBCF192525BD0014596B /* SPGooglePlacesAutocompleteQuery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPGooglePlacesAutocompleteQuery.h; sourceTree = ""; }; + 65D5BBD0192525BD0014596B /* SPGooglePlacesAutocompleteQuery.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPGooglePlacesAutocompleteQuery.m; sourceTree = ""; }; + 65D5BBD1192525BD0014596B /* SPGooglePlacesAutocompleteUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPGooglePlacesAutocompleteUtilities.h; sourceTree = ""; }; + 65D5BBD2192525BD0014596B /* SPGooglePlacesAutocompleteUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPGooglePlacesAutocompleteUtilities.m; sourceTree = ""; }; + 65D5BBD3192525BD0014596B /* SPGooglePlacesAutocompleteViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPGooglePlacesAutocompleteViewController.h; sourceTree = ""; }; + 65D5BBD4192525BD0014596B /* SPGooglePlacesAutocompleteViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPGooglePlacesAutocompleteViewController.m; sourceTree = ""; }; + 65D5BBD5192525BD0014596B /* SPGooglePlacesPlaceDetailQuery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPGooglePlacesPlaceDetailQuery.h; sourceTree = ""; }; + 65D5BBD6192525BD0014596B /* SPGooglePlacesPlaceDetailQuery.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPGooglePlacesPlaceDetailQuery.m; sourceTree = ""; }; 9C4A631D15B64A3F00E15FBA /* SPGooglePlacesAutocomplete.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SPGooglePlacesAutocomplete.app; sourceTree = BUILT_PRODUCTS_DIR; }; 9C4A632115B64A3F00E15FBA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 9C4A632315B64A3F00E15FBA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; @@ -38,23 +49,13 @@ 9C4A632F15B64A3F00E15FBA /* SPGooglePlacesAutocomplete-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SPGooglePlacesAutocomplete-Prefix.pch"; sourceTree = ""; }; 9C4A633015B64A3F00E15FBA /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 9C4A633115B64A3F00E15FBA /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 9C4A633815B64AF700E15FBA /* SPGooglePlacesAutocompleteQuery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPGooglePlacesAutocompleteQuery.h; sourceTree = ""; }; - 9C4A633915B64AF700E15FBA /* SPGooglePlacesAutocompleteQuery.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPGooglePlacesAutocompleteQuery.m; sourceTree = ""; }; 9C4A633B15B64C9200E15FBA /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; - 9C4A633D15B64FA400E15FBA /* SPGooglePlacesAutocompletePlace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPGooglePlacesAutocompletePlace.h; sourceTree = ""; }; - 9C4A633E15B64FA400E15FBA /* SPGooglePlacesAutocompletePlace.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPGooglePlacesAutocompletePlace.m; sourceTree = ""; }; - 9C4A634415B6950B00E15FBA /* SPGooglePlacesAutocompleteViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPGooglePlacesAutocompleteViewController.h; sourceTree = ""; }; - 9C4A634515B6950B00E15FBA /* SPGooglePlacesAutocompleteViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPGooglePlacesAutocompleteViewController.m; sourceTree = ""; }; 9C4A634615B6950B00E15FBA /* SPGooglePlacesAutocompleteViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SPGooglePlacesAutocompleteViewController.xib; sourceTree = ""; }; 9C4A634915B695FA00E15FBA /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; - 9C4A639E15B6A4FB00E15FBA /* SPGooglePlacesAutocompleteUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPGooglePlacesAutocompleteUtilities.h; sourceTree = ""; }; - 9C4A639F15B6A4FB00E15FBA /* SPGooglePlacesAutocompleteUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPGooglePlacesAutocompleteUtilities.m; sourceTree = ""; }; 9C4A63A415B6C01100E15FBA /* location.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = location.png; sourceTree = ""; }; 9C4A63A515B6C01100E15FBA /* location@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "location@2x.png"; sourceTree = ""; }; 9C4A63AC15B6C0DB00E15FBA /* locateButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = locateButton.png; sourceTree = ""; }; 9C4A63AD15B6C0DB00E15FBA /* locateButton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "locateButton@2x.png"; sourceTree = ""; }; - 9C4A63B015B73EA200E15FBA /* SPGooglePlacesPlaceDetailQuery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPGooglePlacesPlaceDetailQuery.h; sourceTree = ""; }; - 9C4A63B115B73EA200E15FBA /* SPGooglePlacesPlaceDetailQuery.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPGooglePlacesPlaceDetailQuery.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -73,6 +74,24 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 65D5BBCB192525BD0014596B /* Library */ = { + isa = PBXGroup; + children = ( + 65D5BBCC192525BD0014596B /* SPGooglePlacesAutocomplete-Prefix.pch */, + 65D5BBCD192525BD0014596B /* SPGooglePlacesAutocompletePlace.h */, + 65D5BBCE192525BD0014596B /* SPGooglePlacesAutocompletePlace.m */, + 65D5BBCF192525BD0014596B /* SPGooglePlacesAutocompleteQuery.h */, + 65D5BBD0192525BD0014596B /* SPGooglePlacesAutocompleteQuery.m */, + 65D5BBD1192525BD0014596B /* SPGooglePlacesAutocompleteUtilities.h */, + 65D5BBD2192525BD0014596B /* SPGooglePlacesAutocompleteUtilities.m */, + 65D5BBD3192525BD0014596B /* SPGooglePlacesAutocompleteViewController.h */, + 65D5BBD4192525BD0014596B /* SPGooglePlacesAutocompleteViewController.m */, + 65D5BBD5192525BD0014596B /* SPGooglePlacesPlaceDetailQuery.h */, + 65D5BBD6192525BD0014596B /* SPGooglePlacesPlaceDetailQuery.m */, + ); + path = Library; + sourceTree = SOURCE_ROOT; + }; 9C4A631215B64A3F00E15FBA = { isa = PBXGroup; children = ( @@ -105,18 +124,9 @@ 9C4A632715B64A3F00E15FBA /* SPGooglePlacesAutocomplete */ = { isa = PBXGroup; children = ( - 9C4A639E15B6A4FB00E15FBA /* SPGooglePlacesAutocompleteUtilities.h */, - 9C4A639F15B6A4FB00E15FBA /* SPGooglePlacesAutocompleteUtilities.m */, + 65D5BBCB192525BD0014596B /* Library */, 9C4A633015B64A3F00E15FBA /* AppDelegate.h */, 9C4A633115B64A3F00E15FBA /* AppDelegate.m */, - 9C4A633815B64AF700E15FBA /* SPGooglePlacesAutocompleteQuery.h */, - 9C4A633915B64AF700E15FBA /* SPGooglePlacesAutocompleteQuery.m */, - 9C4A63B015B73EA200E15FBA /* SPGooglePlacesPlaceDetailQuery.h */, - 9C4A63B115B73EA200E15FBA /* SPGooglePlacesPlaceDetailQuery.m */, - 9C4A633D15B64FA400E15FBA /* SPGooglePlacesAutocompletePlace.h */, - 9C4A633E15B64FA400E15FBA /* SPGooglePlacesAutocompletePlace.m */, - 9C4A634415B6950B00E15FBA /* SPGooglePlacesAutocompleteViewController.h */, - 9C4A634515B6950B00E15FBA /* SPGooglePlacesAutocompleteViewController.m */, 9C4A634615B6950B00E15FBA /* SPGooglePlacesAutocompleteViewController.xib */, 9C4A632815B64A3F00E15FBA /* Supporting Files */, 9C4A63A315B6BFFC00E15FBA /* Resources */, @@ -213,13 +223,13 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 65D5BBDA192525BD0014596B /* SPGooglePlacesAutocompleteViewController.m in Sources */, + 65D5BBD8192525BD0014596B /* SPGooglePlacesAutocompleteQuery.m in Sources */, + 65D5BBDB192525BD0014596B /* SPGooglePlacesPlaceDetailQuery.m in Sources */, + 65D5BBD9192525BD0014596B /* SPGooglePlacesAutocompleteUtilities.m in Sources */, 9C4A632E15B64A3F00E15FBA /* main.m in Sources */, 9C4A633215B64A3F00E15FBA /* AppDelegate.m in Sources */, - 9C4A633A15B64AF700E15FBA /* SPGooglePlacesAutocompleteQuery.m in Sources */, - 9C4A633F15B64FA400E15FBA /* SPGooglePlacesAutocompletePlace.m in Sources */, - 9C4A634715B6950C00E15FBA /* SPGooglePlacesAutocompleteViewController.m in Sources */, - 9C4A63A015B6A4FB00E15FBA /* SPGooglePlacesAutocompleteUtilities.m in Sources */, - 9C4A63B215B73EA300E15FBA /* SPGooglePlacesPlaceDetailQuery.m in Sources */, + 65D5BBD7192525BD0014596B /* SPGooglePlacesAutocompletePlace.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From 7f0e0cf11715b116c4566424fe13d824e8c02a9a Mon Sep 17 00:00:00 2001 From: Andrea Mazzini Date: Thu, 15 May 2014 18:42:30 +0200 Subject: [PATCH 6/8] Reorganized sources --- .../SPGooglePlacesAutocomplete-Prefix.pch | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {Library => SPGooglePlacesAutocomplete}/SPGooglePlacesAutocomplete-Prefix.pch (100%) diff --git a/Library/SPGooglePlacesAutocomplete-Prefix.pch b/SPGooglePlacesAutocomplete/SPGooglePlacesAutocomplete-Prefix.pch similarity index 100% rename from Library/SPGooglePlacesAutocomplete-Prefix.pch rename to SPGooglePlacesAutocomplete/SPGooglePlacesAutocomplete-Prefix.pch From 72313e81761205d2b6cc764d51548af1b1863fe9 Mon Sep 17 00:00:00 2001 From: Andrea Mazzini Date: Thu, 15 May 2014 18:44:36 +0200 Subject: [PATCH 7/8] Updated spec --- SPGooglePlacesAutocomplete.podspec | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/SPGooglePlacesAutocomplete.podspec b/SPGooglePlacesAutocomplete.podspec index e191398..903b9ec 100644 --- a/SPGooglePlacesAutocomplete.podspec +++ b/SPGooglePlacesAutocomplete.podspec @@ -2,20 +2,12 @@ Pod::Spec.new do |s| s.name = "SPGooglePlacesAutocomplete" s.version = "1.0.2" s.summary = "An objective-c wrapper around the Google Places autocomplete API. Includes sample application emulating the Maps app." - s.description = <<-DESC - SPGooglePlacesAutocomplete is a simple objective-c wrapper around the Google Places Autocomplete API. - - The API can be used to provide autocomplete functionality for text-based geographic searches, by returning Places such as businesses, addresses, and points of interest as a user types. - SPGooglePlacesAutocomplete also provides support for converting Place results into CLPlacemark objects for easy mapping with MKMapView. - A longer description of dumy in Markdown format. - DESC s.homepage = "https://github.com/chrischentickbox/SPGooglePlacesAutocomplete" s.license = { :type => 'MIT', :file => 'LICENSE' } s.authors = { "Matej Bukovinski" => "matej@bukovinski.com", "Chris Chen" => "chrischen79@gmail.com" } - s.platform = :ios, '6.0' s.source = { :git => "https://github.com/chrischentickbox/SPGooglePlacesAutocomplete.git", :tag => '1.0.2'} - s.source_files = 'SPGooglePlacesAutocomplete/*.{h,m}' + s.source_files = 'Library/*.{h,m}' s.frameworks = 'CoreLocation' - s.requires_arc = false + s.requires_arc = true end From 85f5f950cc6759bd30bf68718eacaf8f95fad1fc Mon Sep 17 00:00:00 2001 From: Andrea Mazzini Date: Thu, 15 May 2014 18:55:55 +0200 Subject: [PATCH 8/8] Chenged key alert --- Library/SPGooglePlacesAutocompleteQuery.m | 2 +- Library/SPGooglePlacesAutocompleteUtilities.m | 4 ++-- Library/SPGooglePlacesPlaceDetailQuery.m | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Library/SPGooglePlacesAutocompleteQuery.m b/Library/SPGooglePlacesAutocompleteQuery.m index 90ad468..2c04d21 100644 --- a/Library/SPGooglePlacesAutocompleteQuery.m +++ b/Library/SPGooglePlacesAutocompleteQuery.m @@ -74,7 +74,7 @@ - (void)cancelOutstandingRequests { } - (void)fetchPlaces:(SPGooglePlacesAutocompleteResultBlock)block { - if (!SPEnsureGoogleAPIKey()) { + if (!SPEnsureGoogleAPIKey(self.key)) { return; } diff --git a/Library/SPGooglePlacesAutocompleteUtilities.m b/Library/SPGooglePlacesAutocompleteUtilities.m index 7335ff2..44269b2 100644 --- a/Library/SPGooglePlacesAutocompleteUtilities.m +++ b/Library/SPGooglePlacesAutocompleteUtilities.m @@ -26,9 +26,9 @@ SPGooglePlacesAutocompletePlaceType SPPlaceTypeFromDictionary(NSDictionary *plac return (type == SPPlaceTypeGeocode) ? @"geocode" : @"establishment"; } -BOOL SPEnsureGoogleAPIKey() { +BOOL SPEnsureGoogleAPIKey(NSString *key) { BOOL userHasProvidedAPIKey = YES; - if ([kGoogleAPIKey isEqualToString:@"YOUR_API_KEY"]) { + if ([key isEqualToString:@"YOUR_API_KEY"] || [key isEqualToString:@""] || !key) { userHasProvidedAPIKey = NO; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"API Key Needed" message:@"Please replace kGoogleAPIKey with your Google API key." delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil]; [alert show]; diff --git a/Library/SPGooglePlacesPlaceDetailQuery.m b/Library/SPGooglePlacesPlaceDetailQuery.m index c8d2152..1440611 100644 --- a/Library/SPGooglePlacesPlaceDetailQuery.m +++ b/Library/SPGooglePlacesPlaceDetailQuery.m @@ -56,7 +56,7 @@ - (void)cancelOutstandingRequests { } - (void)fetchPlaceDetail:(SPGooglePlacesPlaceDetailResultBlock)block { - if (!SPEnsureGoogleAPIKey()) { + if (!SPEnsureGoogleAPIKey(self.key)) { return; }