is mapKit buggy or am I missing something?

Discussion in 'iOS Programming' started by MACloop, Jun 4, 2010.

  1. MACloop macrumors 6502

    Joined:
    May 18, 2009
    Location:
    Germany
    #1
    Hello,
    In most cases my app works just fine. Sometimes it just crashes and it happends in different situations and very irregular. The log from the device indicates on this problems:
    Code:
    Exception Type:  EXC_BAD_ACCESS (SIGBUS)
    Exception Codes: KERN_PROTECTION_FAILURE at 0x00000010
    Crashed Thread:  0
    
    Thread 0 Crashed:
    0   libobjc.A.dylib               	0x00003ebc objc_msgSend + 20
    1   MapKit                        	0x0000e7f0 -[MKMapView mapLevelViewDidFinishLoading:] + 100
    2   MapKit                        	0x00006740 -[MKMapLevelView _updateLoadingCountWithError:] + 308
    3   MapKit                        	0x0000a250 -[MKMapLevelView _removeTileRequesterForTileView:error:] + 196
    4   MapKit                        	0x00006520 -[MKMapLevelView updateTileAfterReceivingContentForTile:] + 108
    5   MapKit                        	0x00005d3c -[MKMapLevelView tileRequesterReceivedImage:forTile:] + 44
    6   MapKit                        	0x00009b08 -[MKMapLevelView tileRequesterProgress:] + 248
    7   MapKit                        	0x00021d8c MKTileRequester::requestProgress() + 20
    8   GMM                           	0x00006c88 coalesceTimerFired(__CFRunLoopTimer*, void*) + 20
    9   CoreFoundation                	0x000574bc CFRunLoopRunSpecific + 2192
    10  CoreFoundation                	0x00056c18 CFRunLoopRunInMode + 44
    11  GraphicsServices              	0x000041c0 GSEventRunModal + 188
    12  UIKit                         	0x00003c28 -[UIApplication _run] + 552
    13  UIKit                         	0x00002228 UIApplicationMain + 960
    14  theApp                     	0x000022ee 0x1000 + 4846
    15  theApp                     	0x00002298 0x1000 + 4760
    I have search on the internet for simular crashes described by other programmers, but I did not find anything... The last time the app crashed, I have done some zooming on the map and I thought it might be the reason. But, trying to provoke the the app to crash to be repeated by zooming like crazy, did not succeed :-(

    The problem is that I do not know how to understand this crash-report.
    The problem seem to be MKMapLevelView? What is that?
    How do I search for errors in my code connected to this part of the frame work?
    Are there any workarounds for this problem?
    Did anyone have the same problem?

    Any ideas? I am greatful for every hint on this issue!
    Thanks in advance!
    MACloop
     
  2. NickK1066 macrumors regular

    Joined:
    Jul 23, 2007
    #2
    If you can't replicate it by performing a distinct sequence of actions then there's a factor you're not considering.

    As mapkit can and does use delegates and other associated resources, it could be that your application is releasing the connected objects, or not deregistering. When mapkit gets prodded todo some work, it could then wake up to find that it can't reference the objects as they nolonger exist (or have not been set up in the first place).
    When this occurs is completely up to the phone - for example have you received a low memory warning (mapkit is known to have resource leaks and is heavy on memory) that causes your code to release something that still in use?
     
  3. MACloop thread starter macrumors 6502

    Joined:
    May 18, 2009
    Location:
    Germany
    #3
    Thanks for your answer! Well you have a point there with the object released to early in the process. I had this problem with the blue-dot on the map aswell. I am using a navigation controller and the crash always appear when I clikc the back button. I have tried this but I does not seem to help for this zooming problem. I have seen the same problem on other apps aswell. Being in a navigationcontroller and zoom in using two finger-touch very fast and before the map is fully loaded, click the back button. The other apps I tried had the same problem and crashed aswell. Annoying - but there must be some kind of workaround here?

    MACloop
     
  4. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #4
    Turn on zombies. It can help with objcmsg_send crashes.
     
  5. MACloop thread starter macrumors 6502

    Joined:
    May 18, 2009
    Location:
    Germany
    #5
    Thanks for the hint! How do I do that?
    I have tried to activate it but it does not show anything in the console while running the app? am I missing something?
     
  6. jfalexvijay macrumors newbie

    Joined:
    Jul 14, 2010
    #6
    To resolve your problem use below code:

    Code:
    -(void)viewWillDisappear:(BOOL)animated{
    	mapView.delegate = nil;
    	[super viewWillDisappear:animated];
    }
    Thanks.
     

Share This Page