App Crashing When Transition Between Two ViewControllers With AGSMapView

3027
5
Jump to solution
06-28-2016 02:39 PM
PrasadPotale
New Contributor

We are working on a app in which we have AGSMapView on two view controllers
1. MainViewController: In this controller we have map with polygons

2. DetailViewController: This controller is pushed when user taps on polygon on MainViewController, in this controller we are showing map with only tapped polygon

Randomly its crashing when pushing DetailViewController from MainMapViewController, if enabled Zombie objects, its working fine

using v10.2.5

* thread #1: tid = 0x26dc5, 0x00000001808f5b90 libobjc.A.dylib`objc_msgSend + 16, queue = 'com.apple.main-thread', activity = 'starting resolver activity', 1 messages, stop reason = EXC_BAD_ACCESS (code=1, address=0xd3a99398)

    frame #0: 0x00000001808f5b90 libobjc.A.dylib`objc_msgSend + 16

    frame #1: 0x0000000181b66454 Foundation`-[NSObject(NSKeyValueObserverNotification) willChangeValueForKey:] + 324

    frame #2: 0x00000001004680f0 LAFDBrush`-[AGSMapViewBase updateEnv:withKVO:forceUpdateIfNoChange:] + 132

    frame #3: 0x0000000100465014 LAFDBrush`-[AGSMapViewBase ags_spatialReferenceInitialized] + 804

    frame #4: 0x000000010046d098 LAFDBrush`AGSSpatialReferenceInitializedCallback::spatial_reference_initialized_callback() + 52

    frame #5: 0x00000001009cd97c LAFDBrush`Esri_runtimecore::Map_renderer::Map::initialize_layer_manager_() + 1324

    frame #6: 0x00000001009cfd28 LAFDBrush`Esri_runtimecore::Map_renderer::Map::on_pulse_() + 752

    frame #7: 0x00000001003912b0 LAFDBrush`-[AGSMapRenderer pulse:] + 284

    frame #8: 0x00000001025a7768 libglInterpose.dylib`-[DYDisplayLinkInterposer forwardDisplayLinkCallback:] + 172

    frame #9: 0x0000000183db02f0 QuartzCore`CA::Display::DisplayLinkItem::dispatch() + 40

    frame #10: 0x0000000183db01a4 QuartzCore`CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 424

    frame #11: 0x00000001814f5e54 IOKit`IODispatchCalloutFromCFMessage + 372

    frame #12: 0x000000018121d0e0 CoreFoundation`__CFMachPortPerform + 180

    frame #13: 0x000000018123585c CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56

    frame #14: 0x0000000181234f94 CoreFoundation`__CFRunLoopDoSource1 + 436

    frame #15: 0x0000000181232cec CoreFoundation`__CFRunLoopRun + 1800

    frame #16: 0x000000018115cd10 CoreFoundation`CFRunLoopRunSpecific + 384

    frame #17: 0x0000000182a44088 GraphicsServices`GSEventRunModal + 180

    frame #18: 0x0000000186429f70 UIKit`UIApplicationMain + 204

  * frame #19: 0x000000010020b978 LAFDBrush`main + 144 at AppDelegate.swift:17

    frame #20: 0x0000000180cfa8b8 libdyld.dylib`start + 4

0 Kudos
1 Solution

Accepted Solutions
RyanOlson1
Esri Contributor

It looks like you had an observer on the some property of the mapView and that observer was dealloc'd and you didn't remove the obsverver. If that's the case just make sure to call removeObserver in the dealloc method of your observer (usually it's a view controller).

View solution in original post

5 Replies
RyanOlson1
Esri Contributor

It looks like you had an observer on the some property of the mapView and that observer was dealloc'd and you didn't remove the obsverver. If that's the case just make sure to call removeObserver in the dealloc method of your observer (usually it's a view controller).

PrasadPotale
New Contributor

Thanks for reply Ryan,
I've added removeObserver in viewWillDisappear, even I tried commenting add observer code, but still no use. It still crashes randomly.

0 Kudos
RyanOlson1
Esri Contributor

nowhere in your code you add an observer on "visibleAreaEnvelope" and it still crashes?

0 Kudos
PrasadPotale
New Contributor

yes, re-confirmed again, commented all addObserver code and it still crashes. Looks like its not related to addObserver part.

0 Kudos
PrasadPotale
New Contributor

Hi Ryan,
Found the issue, yes its observer, used some third party code for showing compass, which was having observer, so failed to notice it.

Thanks a lot for your help.

0 Kudos