2013-12-17 62 views
0

我的iOS應用程序在Xcode 4.6和iOS 6.1上完成了98%,工作正常。更新爲Xcode 5後的問題

但隨後問題開始,當我嘗試更新我的Xcode 5版和SDK到iOS 7

當我嘗試在Xcode中5,但與iOS 6.1也將繼續工作,正常運行的應用程序,但是當我試圖在SDK 7上運行我有這些問題:

2013-12-17 19:44:47.656 myAPP[2207:70b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<MKUserLocation 0x9d9af90> valueForUndefinedKey:]: this class is not key value coding-compliant for the key distanceAnnotation.' 
*** First throw call stack: 
(
    0 CoreFoundation      0x01bf65e4 __exceptionPreprocess + 180 
    1 libobjc.A.dylib      0x019798b6 objc_exception_throw + 44 
    2 CoreFoundation      0x01c866a1 -[NSException raise] + 17 
    3 Foundation       0x0142d8ca -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 282 
    4 Foundation       0x0139a921 _NSGetUsingKeyValueGetter + 81 
    5 Foundation       0x01399f5b -[NSObject(NSKeyValueCoding) valueForKey:] + 260 
    6 Foundation       0x013b9a5a -[NSObject(NSKeyValueCoding) valueForKeyPath:] + 409 
    7 Foundation       0x013c68c6 _sortedObjectsUsingDescriptors + 380 
    8 Foundation       0x013c66d7 -[NSMutableArray(NSKeyValueSorting) sortUsingDescriptors:] + 578 
    9 myapp 
         0x00009e50 -[mapa mapViewDidFinishLoadingMap:] + 496 
    10 MapKit        0x0037e974 -[MKMapView mapViewDidFinishLoadingTiles:] + 78 
    11 VectorKit       0x050a3ade -[VKMapView mapDidFinishLoadingTiles:] + 78 
    12 VectorKit       0x050abe4e -[VKMapCanvas mapModelDidFinishLoadingTiles:] + 46 
    13 VectorKit       0x050b82cd -[VKMapModel didStopLoadingTilesWithError:] + 77 
    14 VectorKit       0x051ae2e1 -[VKTileProvider didStopLoadingTilesWithError:] + 49 
    15 VectorKit       0x051b1c99 -[VKTileSource didFinishWithNetwork] + 73 
    16 VectorKit       0x051c3aa3 __41-[VKResourcesTileSource performDownload:]_block_invoke73 + 51 
    17 GeoServices       0x04bb98a6 ___ZNK49-[GEOTileLoaderInternal _loadedTile:forKey:info:]66__49-[GEOTileLoaderInternal _loadedTile:forKey:info:]_block_invoke3$_1clERKN8LoadItem9RequesterE_block_invoke_2 + 85 
    18 libdispatch.dylib     0x021f77f8 _dispatch_call_block_and_release + 15 
    19 libdispatch.dylib     0x0220c4b0 _dispatch_client_callout + 14 
    20 libdispatch.dylib     0x021fa75e _dispatch_main_queue_callback_4CF + 340 
    21 CoreFoundation      0x01c5ba5e __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14 
    22 CoreFoundation      0x01b9c6bb __CFRunLoopRun + 1963 
    23 CoreFoundation      0x01b9bac3 CFRunLoopRunSpecific + 467 
    24 CoreFoundation      0x01b9b8db CFRunLoopRunInMode + 123 
    25 GraphicsServices     0x033579e2 GSEventRunModal + 192 
    26 GraphicsServices     0x03357809 GSEventRun + 104 
    27 UIKit        0x004dad3b UIApplicationMain + 1225 
    28 FarmValencia      0x000029ad main + 141 
    29 libdyld.dylib      0x0249e70d start + 1 
) 
libc++abi.dylib: terminating with uncaught exception of type NSException 
+1

請寄出導致這個堆棧跟蹤的代碼。 – dasblinkenlight

+0

可能是因爲您沒有在項目中引用/包括Core Location框架。根據本指南,「位置服務由Core Location框架提供,地圖由Map Kit框架提供。」堆棧跟蹤顯示MapKit,但沒有CoreLocation。 https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/LocationAwarenessPG/Introduction/Introduction.html –

回答

0

即使世界根本就沒有足夠的信息來正確地調試這個項目。

不過,我可以建議你添加一個斷點所有異常

這裏是XCode中4.添加所有異常斷點的例子過程是在XCode中5

http://www.alauda.ro/2013/02/03/xcode-4-exception-breakpoints/

相同

除此之外,你可以嘗試用NSSetUncaughtExceptionHandler

http://www.cocoawithlove.com/2010/05/handling-unhandled-exceptions-and.html

工作

這將允許您捕獲錯誤並輸出結果,但請記住,這是您在調試期間應該只做的事情。

用「#if DEBUG」包裝它是個好主意。

我希望這可以幫助你。這些類型的錯誤是一個難以解決的問題。

注意

您可以檢查鍵值設爲您正在使用SDK的

0

你偶然發送消息valueForUndefinedKey之間並沒有改變:對類MKUserLocation?

這裏的類參考說,關於獲取用戶的位置是什麼:

「的MKUserLocation類定義識別用戶的當前位置的特定類型的註釋不要直接創建該類的實例相反,您檢索。來自應用程序中顯示的地圖視圖的userLocation屬性的現有MKUserLocation對象。「

https://developer.apple.com/library/ios/documentation/MapKit/Reference/MKUserLocation_Class/Reference/Reference.html