2013-06-27 15 views
0

我正在实现一个使用Google地图功能的应用程序,在模拟器和我的iPhone 4设备上一切正常,但是当我尝试构建在iPhone 5的应用程序,我有一个链接器命令失败的问题。谷歌地图SDK 1.3.1链接器命令失败,并在iPhone 5上构建退出代码1错误

附加文件是我在我的生成设置中设置的。

有没有人得到这个问题?我坚持与它近1一周>” <。

这里我的代码在file.h

#import <UIKit/UIKit.h> 
#import <CoreLocation/CoreLocation.h> 
#import <MapKit/MapKit.h> 
#import "MyViewController.h" 
#import "MyAnnotation.h" 
#import <GoogleMaps/GoogleMaps.h> 

@interface PaymentViewController : MyViewController <CLLocationManagerDelegate, GMSMapViewDelegate> { 
    MKMapView *mapView; 
    CLLocationManager *myLocationManager; 
    CLLocation *myLocation; 
    MyAnnotation *annotation; 
    GMSMapView *myGoogleMapView; 
} 

@property (nonatomic, retain) MKMapView *mapView; 
@property (nonatomic, retain) CLLocationManager *myLocationManager; 
@property (nonatomic, retain) MyAnnotation *annotation; 
@property (nonatomic, retain) GMSMapView *myGoogleMapView; 
@property (nonatomic, retain) CLLocation *myLocation; 
@end 

,这里是file.m

#import "PaymentViewController.h" 

@interface PaymentViewController() 

@end 

@implementation PaymentViewController 
@synthesize mapView, myLocationManager, annotation, myGoogleMapView, myLocation; 


-(void)loadView{ 
    [super loadView]; 
    self.title [email protected]"Input Payment"; 


    /*--------- create google map view --------*/ 
    myGoogleMapView = [[GMSMapView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height/3)]; 
    myGoogleMapView.myLocationEnabled = YES; 
    //myGoogleMapView.settings.myLocationButton = YES; 
    myGoogleMapView.mapType = kGMSTypeNormal; 
    [self.view addSubview:myGoogleMapView]; 

} 

- (void)viewWillAppear:(BOOL)animated 
{ 
    [super viewWillAppear:animated]; 

    //this will register the KVO (Key Value Obversing) for key myLocation 
    [self.myGoogleMapView addObserver:self forKeyPath:@"myLocation" options:NSKeyValueObservingOptionNew context: nil]; 
} 


- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context 
{ 

    //this will check the key that we register before and excute the code inside this function 

    if ([keyPath isEqualToString:@"myLocation"] && [object isKindOfClass:[GMSMapView class]]) 
    { 
     GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:self.myGoogleMapView.myLocation.coordinate.latitude longitude:self.myGoogleMapView.myLocation.coordinate.longitude 
                    zoom:17 
            ]; 
     self.myGoogleMapView.camera = camera; 

//  [self.myGoogleMapView animateToCameraPosition:[GMSCameraPosition 
//         cameraWithLatitude:self.myGoogleMapView.myLocation.coordinate.latitude 
//         longitude:self.myGoogleMapView.myLocation.coordinate.longitude 
//         zoom:16]]; 
    } 
} 

- (void)viewWillDisappear:(BOOL)animated 
{ 
    [super viewWillDisappear:animated]; 

    [self.myGoogleMapView removeObserver:self forKeyPath:@"myLocation"]; 
} 
@end 

太谢谢你了!

http://i.stack.imgur.com/5UrhG.png

http://i.stack.imgur.com/D0Q6w.png

回答

相关问题