无法识别的选择器发送到类错误:谷歌地图sdk代码 [英] unrecognized selector sent to class error:google maps sdk code

查看:109
本文介绍了无法识别的选择器发送到类错误:谷歌地图sdk代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Objective-C编程的新手。
我正在为一个项目做google map sdk tutorial。
但它一直给我带来这个错误:

I am new in objective-c programming. I am doing "google map sdk tutorial" for a project. but it keeps bringing me this error:

2013-09-08 21:49:14.670 map-sdk-test1[709:c07] +[GMSCameraPosition cameraWithLatitude:longitude:zoom:]: unrecognized selector sent to class 0x2fcc40
2013-09-08 21:49:14.674 map-sdk-test1[709:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[GMSCameraPosition cameraWithLatitude:longitude:zoom:]: unrecognized selector sent to class 0x2fcc40'
*** First throw call stack:
(0x258dd72 0x23b6e51 0x2619f0d 0x257d9dc 0x257d76e 0x29f3 0x143b0d4 0x143b30e 0x13911fb 0x13914f6 0x139168c 0x1399871 0x26fd 0x13602dc 0x13608c9 0x136196a 0x13722be 0x1372f9f 0x13653fd 0x304cf39 0x304cc10 0x2503da5 0x2503b12 0x2534b46 0x2533ed4 0x2533dab 0x136128f 0x1362e71 0x240d 0x2335)
libc++abi.dylib: terminate called throwing an exception

这是我正在做的教程: https://developers.google.com/maps/documentation/ios/start

this is the tutorial I am doing: https://developers.google.com/maps/documentation/ios/start

我一步步跟着它。

这是发生错误的代码:

this is the code where the error occurs:

    #import "ViewController.h"
    #import <GoogleMaps/GoogleMaps.h>

    @implementation ViewController {
    GMSMapView *mapView_;
    }

    // You don't need to modify the default initWithNibName:bundle: method.

    - (void)loadView {
    // Create a GMSCameraPosition that tells the map to display the
   // coordinate -33.86,151.20 at zoom level 6.
   GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86
                                                             longitude:151.20 zoom:5];


     mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
      mapView_.myLocationEnabled = YES;
      self.view = mapView_;

      // Creates a marker in the center of the map.
      GMSMarker *marker = [[GMSMarker alloc] init];
       marker.position = CLLocationCoordinate2DMake(-33.86, 151.20);
         marker.title = @"Sydney";
        marker.snippet = @"Australia";
         marker.map = mapView_;
      }
  - (void)didReceiveMemoryWarning 
      {
     [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
     }

      - (BOOL)shouldAutorotateToInterfaceOrientation:     (UIInterfaceOrientation)interfaceOrientation
     {
      return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
      }

       @end 

问候

推荐答案

我解决了它:)在建设设置:其他链接器标志;我添加了这个-all_load

I solved it :) in building settings :other linker flags; I added this -all_load

这篇关于无法识别的选择器发送到类错误:谷歌地图sdk代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆