HY,
这是GMSCameraPosition
非常离奇的行为。代码崩溃了viewDidLoad
中写的EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000008
。我正在使用谷歌地图。这是代码。
- (void)viewDidLoad {
[super viewDidLoad];
self.extendedLayoutIncludesOpaqueBars = TRUE;
GMSCameraPosition *camera =
[GMSCameraPosition cameraWithLatitude:[AppConfig sharedInstance].theLocation.latitude
longitude:[AppConfig sharedInstance].theLocation.longitude
zoom:14];
homeMapView = [GMSMapView mapWithFrame:CGRectZero camera:camera]; // Code crashes here
homeMapView.settings.compassButton = YES;
homeMapView.settings.myLocationButton = YES;
homeMapView.settings.zoomGestures = YES;
homeMapView.delegate = self;
self.view = homeMapView;
}
如果有人遇到这种行为,如何对其进行排序。这是崩解剂堆栈,请帮助:
Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x18a7fa804 object_isClass + 24
1 Foundation 0x18c7d49b8 -[NSObject(NSKeyValueObserverNotification) willChangeValueForKey:] + 328
2 HooSafe 0x100465f94 -[GMSMapView internalSetCamera:] + 4299415444
3 HooSafe 0x100462608 -[GMSMapView setCamera:] + 4299400712
4 HooSafe 0x100460f8c -[GMSMapView sharedInitWithServices:camera:forPlaces:] + 4299394956
5 HooSafe 0x10045ff84 -[GMSMapView initWithFrame:camera:] + 4299390852
6 HooSafe 0x10045fdc8 +[GMSMapView mapWithFrame:camera:] + 4299390408
7 HooSafe 0x10011dc14 -[DemoViewController viewDidLoad] (DemoViewController.m:107)
8 UIKit 0x191c7a924 -[UIViewController loadViewIfRequired] + 1056
9 UIKit 0x191d342bc -[UINavigationController _layoutViewController:] + 72
10 UIKit 0x191d34194 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 416
11 UIKit 0x191d334dc -[UINavigationController _startTransition:fromViewController:toViewController:] + 140
12 UIKit 0x191d32f28 -[UINavigationController _startDeferredTransitionIfNeeded:] + 856
13 UIKit 0x191d32adc -[UINavigationController __viewWillLayoutSubviews] + 64
14 UIKit 0x191d32a40 -[UILayoutContainerView layoutSubviews] + 188
15 UIKit 0x191c77a80 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1196
16 QuartzCore 0x18f1259d8 -[CALayer layoutSublayers] + 148
17 QuartzCore 0x18f11a4cc CA::Layer::layout_if_needed(CA::Transaction*) + 292
18 QuartzCore 0x18f11a38c CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32
19 QuartzCore 0x18f0973e0 CA::Context::commit_transaction(CA::Transaction*) + 252
20 QuartzCore 0x18f0bea68 CA::Transaction::commit() + 512
21 QuartzCore 0x18f0bf488 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 120
22 CoreFoundation 0x18bd720c0 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
23 CoreFoundation 0x18bd6fcf0 __CFRunLoopDoObservers + 372
24 CoreFoundation 0x18bd70180 __CFRunLoopRun + 1024
25 CoreFoundation 0x18bc9e2b8 CFRunLoopRunSpecific + 444
26 GraphicsServices 0x18d752198 GSEventRunModal + 180
27 UIKit 0x191ce57fc -[UIApplication _run] + 684
28 UIKit 0x191ce0534 UIApplicationMain + 208
29 HooSafe 0x1000b12d0 main (main.m:16)
30 libdispatch.dylib 0x18ac815b8 (Missing)