- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我遵循 getting started 中的每一步使用适用于 ios 的谷歌地图,我做的一切都很好,但在我尝试的每个示例中,模拟器开始询问我是否要打开 GPS,之后,它会抛出错误:
2013-03-07 16:05:09.135 Cicerone4all[352:14e03] Google Maps SDK for iOS version: 1.1.0.2080
2013-03-07 16:05:09.750 Cicerone4all[352:10d03] -[__NSCFDictionary objectForKeyedSubscript:]: unrecognized selector sent to instance 0xcac9b40
2013-03-07 16:05:09.755 Cicerone4all[352:10d03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary objectForKeyedSubscript:]: unrecognized selector sent to instance 0xcac9b40'
*** First throw call stack:
(0x24a5022 0x2636d0a 0x24a6cbd 0x240bed0 0x240bcb2 0xc7d21 0x14ea9e 0x14dc05 0x15f0a6 0x15ce9e 0x1606d7 0xe5e64 0x132a43 0x131842 0x7f312f 0x7f3003 0x2479936 0x24793d7 0x23dc790 0x23dbd84 0x23dbc9b 0x2d3a7d8 0x2d3a88a 0x14dea16 0x270d 0x2675)
terminate called throwing an exception(lldb)
应用委托(delegate):
#import "AppDelegate.h"
#import "ViewController.h"
@implementation AppDelegate
@synthesize window = _window;
@synthesize viewController = _viewController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[GMSServices provideAPIKey:@"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"];
// Override point for customization after application launch.
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
@end
View Controller :
#import "ViewController.h"
#import <GoogleMaps/GoogleMaps.h>
@interface ViewController ()
@end
@implementation ViewController{
GMSMapView *mapView_;
}
- (void)loadView {
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.8683
longitude:151.2086
zoom:6];
mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
mapView_.myLocationEnabled = YES;
self.view = mapView_;
GMSMarkerOptions *options = [[GMSMarkerOptions alloc] init];
options.position = CLLocationCoordinate2DMake(-33.8683, 151.2086);
options.title = @"Sydney";
options.snippet = @"Australia";
[mapView_ addMarkerWithOptions:options];
}
@end
堆栈跟踪:
UIKit`UIApplicationMain:
0x14de58b: pushl %ebp
0x14de58c: movl %esp, %ebp
0x14de58e: pushl %ebx
0x14de58f: pushl %edi
0x14de590: pushl %esi
0x14de591: subl $44, %esp
0x14de594: calll 0x014de599 ; UIApplicationMain + 14
0x14de599: popl %eax
0x14de59a: movl %eax, -16(%ebp)
0x14de59d: movl $1, (%esp)
0x14de5a4: calll 0x014dbc6e ; _UIApplicationLinkedOnOrAfter
0x14de5a9: xorl %ecx, %ecx
0x14de5ab: testb %al, %al
0x14de5ad: je 0x014de5de ; UIApplicationMain + 83
0x14de5af: movl -16(%ebp), %esi
0x14de5b2: movl 6976791(%esi), %eax
0x14de5b8: movl 6929119(%esi), %ecx
0x14de5be: movl %ecx, 4(%esp)
0x14de5c2: movl %eax, (%esp)
0x14de5c5: calll 0x0198790a ; objc_msgSend
0x14de5ca: movl 6929295(%esi), %ecx
0x14de5d0: movl %ecx, 4(%esp)
0x14de5d4: movl %eax, (%esp)
0x14de5d7: calll 0x0198790a ; objc_msgSend
0x14de5dc: movl %eax, %ecx
0x14de5de: movl %ecx, -20(%ebp)
0x14de5e1: movl 8(%ebp), %edi
0x14de5e4: cmpl $2, %edi
0x14de5e7: jl 0x014de659 ; UIApplicationMain + 206
0x14de5e9: movl 12(%ebp), %ebx
0x14de5ec: addl $4, %ebx
0x14de5ef: decl %edi
0x14de5f0: movl (%ebx), %esi
0x14de5f2: movl -16(%ebp), %eax
0x14de5f5: leal 5455388(%eax), %eax
0x14de5fb: movl %eax, 4(%esp)
0x14de5ff: movl %esi, (%esp)
0x14de602: calll 0x01987a3c ; strcmp
0x14de607: testl %eax, %eax
0x14de609: jne 0x014de617 ; UIApplicationMain + 140
0x14de60b: movl -16(%ebp), %eax
0x14de60e: movb $1, 7181316(%eax)
0x14de615: jmp 0x014de653 ; UIApplicationMain + 200
0x14de617: movl -16(%ebp), %eax
0x14de61a: leal 5450169(%eax), %eax
0x14de620: movl %eax, 4(%esp)
0x14de624: movl %esi, (%esp)
0x14de627: calll 0x01987a3c ; strcmp
0x14de62c: testl %eax, %eax
0x14de62e: je 0x014de649 ; UIApplicationMain + 190
0x14de630: movl -16(%ebp), %eax
0x14de633: leal 5450194(%eax), %eax
0x14de639: movl %eax, 4(%esp)
0x14de63d: movl %esi, (%esp)
0x14de640: calll 0x01987a3c ; strcmp
0x14de645: testl %eax, %eax
0x14de647: jne 0x014de653 ; UIApplicationMain + 200
0x14de649: movl -16(%ebp), %eax
0x14de64c: movb $1, 7181319(%eax)
0x14de653: addl $4, %ebx
0x14de656: decl %edi
0x14de657: jne 0x014de5f0 ; UIApplicationMain + 101
0x14de659: movl 16(%ebp), %ebx
0x14de65c: calll 0x014e1026 ; UIApplicationInitialize
0x14de661: movl -16(%ebp), %edx
0x14de664: movl 6976747(%edx), %eax
0x14de66a: movl 6928967(%edx), %ecx
0x14de670: movl %edx, %esi
0x14de672: movl %ecx, 4(%esp)
0x14de676: movl %eax, (%esp)
0x14de679: calll 0x0198790a ; objc_msgSend
0x14de67e: movl %eax, %edi
0x14de680: testl %ebx, %ebx
0x14de682: jne 0x014de6cc ; UIApplicationMain + 321
0x14de684: movl 6976767(%esi), %eax
0x14de68a: movl 6929687(%esi), %ecx
0x14de690: movl %ecx, 4(%esp)
0x14de694: movl %eax, (%esp)
0x14de697: calll 0x0198790a ; objc_msgSend
0x14de69c: movl 6929695(%esi), %ecx
0x14de6a2: movl %ecx, 4(%esp)
0x14de6a6: movl %eax, (%esp)
0x14de6a9: calll 0x0198790a ; objc_msgSend
0x14de6ae: movl 6929699(%esi), %ecx
0x14de6b4: leal 7032327(%esi), %edx
0x14de6ba: movl %edx, 8(%esp)
0x14de6be: movl %ecx, 4(%esp)
0x14de6c2: movl %eax, (%esp)
0x14de6c5: calll 0x0198790a ; objc_msgSend
0x14de6ca: movl %eax, %ebx
0x14de6cc: movl 6929707(%esi), %eax
0x14de6d2: movl %eax, 4(%esp)
0x14de6d6: movl %ebx, (%esp)
0x14de6d9: calll 0x0198790a ; objc_msgSend
0x14de6de: testl %eax, %eax
0x14de6e0: je 0x014de78e ; UIApplicationMain + 515
0x14de6e6: movl %ebx, (%esp)
0x14de6e9: calll 0x01987214 ; NSClassFromString
0x14de6ee: movl %eax, %edi
0x14de6f0: testl %edi, %edi
0x14de6f2: jne 0x014de78e ; UIApplicationMain + 515
0x14de6f8: movl 6976639(%esi), %eax
0x14de6fe: movl 6928919(%esi), %ecx
0x14de704: movl %ecx, 4(%esp)
0x14de708: movl %eax, (%esp)
0x14de70b: calll 0x0198790a ; objc_msgSend
0x14de710: movl %eax, -16(%ebp)
0x14de713: movl 6976643(%esi), %eax
0x14de719: movl 6928923(%esi), %ecx
0x14de71f: leal 5450237(%esi), %edx
0x14de725: movl %edx, 8(%esp)
0x14de729: movl %ecx, 4(%esp)
0x14de72d: movl %eax, (%esp)
0x14de730: calll 0x0198790a ; objc_msgSend
0x14de735: movl %eax, %edi
0x14de737: movl 6976643(%esi), %eax
0x14de73d: movl 6928923(%esi), %ecx
0x14de743: leal 5448982(%esi), %edx
0x14de749: movl %edx, 8(%esp)
0x14de74d: movl %ecx, 4(%esp)
0x14de751: movl %eax, (%esp)
0x14de754: calll 0x0198790a ; objc_msgSend
0x14de759: movl 6930011(%esi), %ecx
0x14de75f: movl %ebx, 24(%esp)
0x14de763: leal 7032343(%esi), %edx
0x14de769: movl %edx, 20(%esp)
0x14de76d: movl %eax, 12(%esp)
0x14de771: movl %edi, 8(%esp)
0x14de775: movl %ecx, 4(%esp)
0x14de779: movl -16(%ebp), %eax
0x14de77c: movl %eax, (%esp)
0x14de77f: movl $1732, 16(%esp)
0x14de787: calll 0x0198790a ; objc_msgSend
0x14de78c: xorl %edi, %edi
0x14de78e: leal 1159(%esi), %eax
0x14de794: movl %eax, (%esp)
0x14de797: calll 0x019870be ; GSEventRegisterEventCallBack
0x14de79c: movl 6928967(%esi), %eax
0x14de7a2: movl %eax, 4(%esp)
0x14de7a6: movl %edi, (%esp)
0x14de7a9: calll 0x0198790a ; objc_msgSend
0x14de7ae: movl 6929831(%esi), %ecx
0x14de7b4: movl %ecx, 4(%esp)
0x14de7b8: movl %eax, (%esp)
0x14de7bb: calll 0x0198790a ; objc_msgSend
0x14de7c0: testb %al, %al
0x14de7c2: setne %al
0x14de7c5: movzbl %al, %eax
0x14de7c8: movl %eax, (%esp)
0x14de7cb: calll 0x01987070 ; GSEventInitialize
0x14de7d0: movl 6432387(%esi), %eax
0x14de7d6: movl (%eax), %eax
0x14de7d8: movl %eax, (%esp)
0x14de7db: calll 0x019870ac ; GSEventPushRunLoopMode
0x14de7e0: calll 0x019873b2 ; SBSSpringBoardServerPort
0x14de7e5: movl 6432211(%esi), %ecx
0x14de7eb: movl (%ecx), %ecx
0x14de7ed: movl %ecx, 4(%esp)
0x14de7f1: movl %eax, (%esp)
0x14de7f4: calll 0x0198731c ; SBCheckInTaskPort
0x14de7f9: movl 6930015(%esi), %eax
0x14de7ff: movl %eax, 4(%esp)
0x14de803: movl %edi, (%esp)
0x14de806: calll 0x0198790a ; objc_msgSend
0x14de80b: movl %edi, (%esp)
0x14de80e: calll 0x014de40d ; UIApplicationInstantiateSingleton
0x14de813: movl 6976647(%esi), %eax
0x14de819: movl 6928943(%esi), %ecx
0x14de81f: movl %ecx, 4(%esp)
0x14de823: movl %eax, (%esp)
0x14de826: calll 0x0198790a ; objc_msgSend
0x14de82b: movl 6928975(%esi), %ecx
0x14de831: movl %esi, %edi
0x14de833: movl %ecx, 4(%esp)
0x14de837: movl %eax, (%esp)
0x14de83a: calll 0x0198790a ; objc_msgSend
0x14de83f: testb %al, %al
0x14de841: je 0x014de85b ; UIApplicationMain + 720
0x14de843: movl 6976831(%edi), %eax
0x14de849: movl 6930019(%edi), %ecx
0x14de84f: movl %ecx, 4(%esp)
0x14de853: movl %eax, (%esp)
0x14de856: calll 0x0198790a ; objc_msgSend
0x14de85b: movl 20(%ebp), %ebx
0x14de85e: testl %ebx, %ebx
0x14de860: jne 0x014de8b2 ; UIApplicationMain + 807
0x14de862: movl 6976767(%edi), %eax
0x14de868: movl 6929687(%edi), %ecx
0x14de86e: movl %ecx, 4(%esp)
0x14de872: movl %eax, (%esp)
0x14de875: calll 0x0198790a ; objc_msgSend
0x14de87a: movl 6929695(%edi), %ecx
0x14de880: movl %ecx, 4(%esp)
0x14de884: movl %eax, (%esp)
0x14de887: calll 0x0198790a ; objc_msgSend
0x14de88c: movl 6929699(%edi), %ecx
0x14de892: leal 7032359(%edi), %edx
0x14de898: movl %edx, 8(%esp)
0x14de89c: movl %ecx, 4(%esp)
0x14de8a0: movl %eax, (%esp)
0x14de8a3: calll 0x0198790a ; objc_msgSend
0x14de8a8: movl %eax, %ebx
0x14de8aa: testl %ebx, %ebx
0x14de8ac: je 0x014de9e9 ; UIApplicationMain + 1118
0x14de8b2: movl %ebx, (%esp)
0x14de8b5: calll 0x01987214 ; NSClassFromString
0x14de8ba: testl %eax, %eax
0x14de8bc: movl %eax, -16(%ebp)
0x14de8bf: jne 0x014de959 ; UIApplicationMain + 974
0x14de8c5: movl 6976639(%edi), %eax
0x14de8cb: movl 6928919(%edi), %ecx
0x14de8d1: movl %ecx, 4(%esp)
0x14de8d5: movl %eax, (%esp)
0x14de8d8: calll 0x0198790a ; objc_msgSend
0x14de8dd: movl %eax, -24(%ebp)
0x14de8e0: movl 6976643(%edi), %eax
0x14de8e6: movl 6928923(%edi), %ecx
0x14de8ec: leal 5450237(%edi), %edx
0x14de8f2: movl %edx, 8(%esp)
0x14de8f6: movl %ecx, 4(%esp)
0x14de8fa: movl %eax, (%esp)
0x14de8fd: calll 0x0198790a ; objc_msgSend
0x14de902: movl %eax, %esi
0x14de904: movl 6976643(%edi), %eax
0x14de90a: movl 6928923(%edi), %ecx
0x14de910: leal 5448982(%edi), %edx
0x14de916: movl %edx, 8(%esp)
0x14de91a: movl %ecx, 4(%esp)
0x14de91e: movl %eax, (%esp)
0x14de921: calll 0x0198790a ; objc_msgSend
0x14de926: movl 6930011(%edi), %ecx
0x14de92c: movl %ebx, 24(%esp)
0x14de930: leal 7032375(%edi), %edx
0x14de936: movl %edx, 20(%esp)
0x14de93a: movl %eax, 12(%esp)
0x14de93e: movl %esi, 8(%esp)
0x14de942: movl %ecx, 4(%esp)
0x14de946: movl -24(%ebp), %eax
0x14de949: movl %eax, (%esp)
0x14de94c: movl $1765, 16(%esp)
0x14de954: calll 0x0198790a ; objc_msgSend
0x14de959: movl 6976747(%edi), %eax
0x14de95f: movl 6928967(%edi), %ecx
0x14de965: movl %ecx, 4(%esp)
0x14de969: movl %eax, (%esp)
0x14de96c: calll 0x0198790a ; objc_msgSend
0x14de971: movl 6930023(%edi), %ecx
0x14de977: movl %eax, 8(%esp)
0x14de97b: movl %ecx, 4(%esp)
0x14de97f: movl -16(%ebp), %esi
0x14de982: movl %esi, (%esp)
0x14de985: calll 0x0198790a ; objc_msgSend
0x14de98a: movl 7181311(%edi), %ebx
0x14de990: testb %al, %al
0x14de992: je 0x014de9a7 ; UIApplicationMain + 1052
0x14de994: movl 6929035(%edi), %eax
0x14de99a: movl %ebx, 8(%esp)
0x14de99e: movl %eax, 4(%esp)
0x14de9a2: movl %ebx, (%esp)
0x14de9a5: jmp 0x014de9e4 ; UIApplicationMain + 1113
0x14de9a7: movl 6929119(%edi), %eax
0x14de9ad: movl %eax, 4(%esp)
0x14de9b1: movl %esi, (%esp)
0x14de9b4: calll 0x0198790a ; objc_msgSend
0x14de9b9: movl 6929295(%edi), %ecx
0x14de9bf: movl %ecx, 4(%esp)
0x14de9c3: movl %eax, (%esp)
0x14de9c6: calll 0x0198790a ; objc_msgSend
0x14de9cb: movl 6930027(%edi), %ecx
0x14de9d1: movl %eax, 8(%esp)
0x14de9d5: movl %ecx, 4(%esp)
0x14de9d9: movl %ebx, (%esp)
0x14de9dc: movl $1, 12(%esp)
0x14de9e4: calll 0x0198790a ; objc_msgSend
0x14de9e9: movl 6928887(%edi), %eax
0x14de9ef: movl %eax, 4(%esp)
0x14de9f3: movl -20(%ebp), %eax
0x14de9f6: movl %eax, (%esp)
0x14de9f9: calll 0x0198790a ; objc_msgSend
0x14de9fe: movl 7181311(%edi), %eax
0x14dea04: movl 6930031(%edi), %ecx
0x14dea0a: movl %ecx, 4(%esp)
0x14dea0e: movl %eax, (%esp)
0x14dea11: calll 0x0198790a ; objc_msgSend
0x14dea16: xorl %eax, %eax <<<<<<<<<<<<<<<<<<<<<<<<<< Signal SIGABRT
0x14dea18: addl $44, %esp
0x14dea1b: popl %esi
0x14dea1c: popl %edi
0x14dea1d: popl %ebx
0x14dea1e: popl %ebp
0x14dea1f: ret
注意:错误是在我的 ViewController 加载 View 之前抛出的。
最佳答案
您是否在说明的第 7 步中添加了 -ObjC
标志?
关于iOS GoogleMaps SDK 错误 : "[__NSCFDictionary objectForKeyedSubscript:]: Unrecognized selector sent",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15108418/
我最近将 Xcode 更新到 11.3.1 版,之后我无法运行我的应用程序。我一直收到以下异常: 2020-02-11 16:13:04.767795-0600 UVM[5204:80616] -[E
我正在尝试使用 horton 模式注册表在 kafka 中使用 avro 格式的消息。问题是,当我尝试发布 avro 消息时,我收到此错误: Caused by: com.fasterxml.jack
我正在尝试在 Red Hat Linux 上安装 MySql Server。 我已经下载了 tar文件并将其解压缩。 然后,我跑了: rpm -qpl mysql-community-server-5
在 fedora 22 上,我发现所有标准的 go 库在 go 的路径上都不可见。 注意 我确实清理了我的 golang 系统 - 所以我很确定这不是升级 go 时经常发生的混合包版本控制问题。 注意
这个问题在这里已经有了答案: systemctl command doesn't work inside docker-container (2 个回答) 8 个月前关闭。 我是 docker 新手,
如何保护注销操作?我读了default configuration并设置了 logout: csrf_parameter: _token csrf_provider:
我按照说明here按照以下步骤在 WSL 上安装 mariadb。我运行这个sudo service mysql start我有mysql: unrecognized service知道如何解决这个问
我需要选择一个隐藏字段才能将其删除。我想按类型、自定义数据属性和名称选择它。我的选择器如下所示: $("input[type=hidden] data-supplied='Cola' name='co
我正在Ubuntu 16.04上针对ARM体系结构交叉编译gpsd3.20。如您所知,gpsd使用Sconsctruct来编译源代码。在我进行交叉编译时,需要创建libgps.so的那一刻显示了unr
我正在实现 Skobbler SDK (v2.5),但我在第一步中遇到了问题。 应用程序因以下错误而崩溃:[SKVectorMapView displayTrafficWithMode:]:无法识别的
我正在使用以下命令运行 Java: java -Xms3G -Xmx3G -Xmn1G -XX:TargetSurvivorRatio=80 -XX:MaxTenuringThreshold=15 -
我正在使用 django 和 VB Linux Red Hat。我尝试过使用命令 python manage.py runserver - 192.168.1.100:8000 为了访问我的网站。到目
我正在处理使用 CodeIgniter 和 HTML5 布局的新网站。 我从我的旧网站复制了一些代码,但当我在我的新网站上尝试这个时,它给了我这个错误: Error: Syntax error, un
在用 Flex 编写 token 生成器时,我遇到了这个恼人的错误:“无法识别的规则” 我的代码是: /* Keywords */ TYPE int|double|bool|char L
我正在测试 Android Pay API。我使用命令生成了公钥 $ openssl ec -in merchant-key.pem -pubout -text -noout 和 echo $PUBL
我有几行代码可以用 Java 读取文件的内容。基本上我使用的是 FileReader 和 BufferedReader。我正在正确阅读这些行,但是,第一行的第一个字符似乎是一个 undefined s
UIView *v2 = ({ UIView *view = [UIView new]; [self.view addSubview:view]; [v
我遇到了一种情况,我有一个用 javascript 编写的表单,它为人们创建个人资料,详细说明了他们的姓名简历等。无论如何,我尝试向此表单添加一些新字段,但我添加的每个新字段都是当我尝试编辑个人资料信
在我的 ViewController 类中,我有一个函数: func updateTimes() { // (code) } 我创建了一个计时器: class ViewController: NS
我正在尝试运行 Behat(对我来说是第一次)并且成功了。 但是我有一个配置问题。我尝试像这样更改功能和 Bootstrap 的路径: #behat.yml default: paths:
我是一名优秀的程序员,十分优秀!