Uploaded image for project: 'Appcelerator - INBOX'
  1. Appcelerator - INBOX
  2. AC-5287

Ti.Map: iOS crash when hiding/showing notifications after selecting annotation

    Details

      Description

      Problem:
      App closes without showing any error when doing the following:

      • select an annotation
      • click the switch button (it will remove all annotations and show them again)
      • select a different annotation
      • click the switch button again
      • app will crash

      Error:
      App closes and I only have this error in the device log:

      Thread 0 name:  Dispatch queue: com.apple.main-thread
      Thread 0 Crashed:
      0   libobjc.A.dylib               	0x2240867a objc_retain + 10
      1   MapKit                        	0x2bec9776 -[MKAnnotationManager dequeueReusableAnnotationRepresentationWithIdentifier:] + 110
      2   test_map                      	0x004ce500 0x102000 + 3982592
      3   MapKit                        	0x2bf03314 -[MKMapView annotationManager:representationForAnnotation:] + 336
      4   MapKit                        	0x2bec93a8 -[MKAnnotationManager _addRepresentationForAnnotation:] + 340
      5   MapKit                        	0x2bec7f9a -[MKAnnotationManager updateVisibleAnnotations] + 1190
      6   Foundation                    	0x2347e654 __NSFireTimer + 64
      7   CoreFoundation                	0x22c1658e __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 14
      8   CoreFoundation                	0x22c161c0 __CFRunLoopDoTimer + 936
      9   CoreFoundation                	0x22c1400c __CFRunLoopRun + 1484
      10  CoreFoundation                	0x22b63228 CFRunLoopRunSpecific + 520
      11  CoreFoundation                	0x22b63014 CFRunLoopRunInMode + 108
      12  GraphicsServices              	0x24153ac8 GSEventRunModal + 160
      13  UIKit                         	0x27237188 UIApplicationMain + 144
      14  test_map                      	0x00108c40 0x102000 + 27712
      15  libdyld.dylib                 	0x2280b872 start + 2
      

      Code:

      var Map = require('ti.map');
      var win = Titanium.UI.createWindow();
      var ar = [];
       
      for (var i = 0; i < 20; ++i) {
      	var mountainView = Map.createAnnotation({
      		latitude: 37 + (Math.random() * 5),
      		longitude: -122 + (Math.random() * 5),
      		title: "Appcelerator Headquarters",
      		subtitle: 'Mountain View, CA',
      		pincolor: Map.ANNOTATION_RED,
      	});
      	ar.push(mountainView);
      }
       
      var mapview = Map.createView({
      	mapType: Map.NORMAL_TYPE,
      	region: {
      		latitude: 37.3,
      		longitude: -122.3,
      		latitudeDelta: 0.5,
      		longitudeDelta: 0.5
      	},
      	animate: true,
      	regionFit: true,
      	userLocation: true
      });
       
      mapview.setAnnotations(ar);
       
      var btn1 = Ti.UI.createButton({
      	title: "switch",
      	bottom: 10
      });
       
      btn1.addEventListener("click", function(e) {
      	mapview.removeAllAnnotations();
      	setTimeout(function() {
      		mapview.setAnnotations(ar);
      	}, 1000);
      });
      win.add(mapview);
      win.add(btn1);
      win.open();
      

      Module: Ti.Map 3.0.0
      Platform: iOS (device and simulator)

      Android is working with the example from above

        Attachments

          Activity

            People

            • Assignee:
              hknoechel Hans Knöchel
              Reporter:
              michael Michael Gangolf
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Source Code