每次Mapview出现时应用程序都会崩溃。崩溃日志
Incident Identifier: *****
CrashReporter Key: ******
Hardware Model: iPhone6,1
Process: **** [3841]
Path: ****
Identifier: *****
Version: 1.0 (1.0)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2014-03-20 22:58:50.614 -0400
OS Version: iOS 7.0.3 (11B511)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Last Exception Backtrace:
(0x2f19ee83 0x394ff6c7 0x2f19eb89 0x3036aa19 0x3036ac5b 0x19d101 0x3193d73f 0x3193dbcd 0x319e9dbb 0x31ab51e9 0x31a399e3 0x31afa5a9 0x3195ae6d 0x3195aab7 0x3195a9cf 0x315b0413 0x399e40af 0x399e69a9 0x2f1695b1 0x2f167e7d 0x2f0d2471 0x2f0d2253 0x33e062eb 0x31987845 0xea0f3 0xea0a8)
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x39aaf1fc 0x39a9c000 + 78332
1 libsystem_pthread.dylib 0x39b16a4f 0x39b13000 + 14927
2 libsystem_c.dylib 0x39a60029 0x39a16000 + 303145
3 libc++abi.dylib 0x38eae98b 0x38eae000 + 2443
4 libc++abi.dylib 0x38ec76e3 0x38eae000 + 104163
5 libobjc.A.dylib 0x394ff937 0x394f7000 + 35127
6 libc++abi.dylib 0x38ec51b1 0x38eae000 + 94641
7 libc++abi.dylib 0x38ec4a05 0x38eae000 + 92677
8 libobjc.A.dylib 0x394ff797 0x394f7000 + 34711
9 CoreFoundation 0x2f19eb85 0x2f0ca000 + 871301
10 MapKit 0x3036aa15 0x3032e000 + 248341
11 MapKit 0x3036ac57 0x3032e000 + 248919
12 FishCacher 0x0019d0fd 0xe6000 + 749821
13 UIKit 0x3193d73b 0x31918000 + 153403
14 UIKit 0x3193dbc9 0x31918000 + 154569
15 UIKit 0x319e9db7 0x31918000 + 859575
16 UIKit 0x31ab51e5 0x31918000 + 1692133
17 UIKit 0x31a399e1 0x31918000 + 1186273
18 UIKit 0x31afa5a5 0x31918000 + 1975717
19 UIKit 0x3195ae6b 0x31918000 + 274027
20 UIKit 0x3195aab3 0x31918000 + 273075
21 UIKit 0x3195a9cb 0x31918000 + 272843
22 QuartzCore 0x315b040f 0x3159d000 + 78863
23 libdispatch.dylib 0x399e40ad 0x399e3000 + 4269
24 libdispatch.dylib 0x399e69a5 0x399e3000 + 14757
25 CoreFoundation 0x2f1695ad 0x2f0ca000 + 652717
26 CoreFoundation 0x2f167e79 0x2f0ca000 + 646777
27 CoreFoundation 0x2f0d246d 0x2f0ca000 + 33901
28 CoreFoundation 0x2f0d224f 0x2f0ca000 + 33359
29 GraphicsServices 0x33e062e7 0x33dff000 + 29415
30 UIKit 0x31987841 0x31918000 + 456769
31 FishCacher 0x000ea0ef 0xe6000 + 16623
32 FishCacher 0x000ea0a4 0xe6000 + 16548
Thread 1:
0 libsystem_kernel.dylib 0x39a9c838 0x39a9c000 + 2104
1 libdispatch.dylib 0x399eb0d1 0x399e3000 + 32977
2 libdispatch.dylib 0x399e561f 0x399e3000 + 9759
这是我的代码
[self.mapView removeAnnotations:self.mapView.annotations];
[[LDAnnotationClickable instance] addPinButtonWithDelegate:self];
[[LDAnnotationClickable instance] recover];
CLLocationCoordinate2D thisCurrentlocation;
thisCurrentlocation.latitude = [self.strThisCurrentLat doubleValue];
thisCurrentlocation.longitude = [self.strThisCurrentLong doubleValue];
NSLog(@"lat11 lon11 %f %f",thisCurrentlocation.latitude,thisCurrentlocation.longitude);
MKCoordinateRegion mapRegion;
// set the center of the map region to the now updated map view center
mapRegion.center = self.mapView.centerCoordinate;
mapRegion.span.latitudeDelta = thisCurrentlocation.latitude; // you likely don't need these... just kinda hacked this out
mapRegion.span.longitudeDelta = thisCurrentlocation.longitude;
mapView.region=mapRegion;
MapViewAnnotation *newAnnotation = [[MapViewAnnotation alloc] initWithTitle:@"Current Location" andSubTitle:@""andCoordinate:thisCurrentlocation];
newAnnotation.numberID = @"";
[self.mapView addAnnotation:newAnnotation];