簡體   English   中英

存檔的應用僅在iOS 5.1上崩潰,而不在5.0上崩潰

[英]Archived app crashes only on iOS 5.1 not on 5.0

我已經存檔了我的應用程序,並准備進行測試。

當我運行此應用程序時,我沒有在ios5版本上發現任何崩潰。(我沒有5.1設備)但是我的客戶端具有5.1版本,當他嘗試按一下應用程序內的某些按鈕時遇到崩潰的情況。

所以我問他崩潰報告如下

Date/Time:       2012-04-23 12:54:10.320 +1000
OS Version:      iPhone OS 5.1 (9B179)
Report Version:  104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread:  0

Last Exception Backtrace:
(0x3788488f 0x35d8a259 0x37884789 0x378847ab 0x38037a1b 0x9451 0x2493b 0x33f69e33 0x33f76391 0x33f76201 0x33f760e7 0x33f75969 0x33f756ab 0x33f69ca7 0x33f6997d 0xb397 0xc21f 0x3408f3cb 0x377de3fd 0x33f4bfaf 0x33f4bf6b 0x33f4bf49 0x33f4bcb9 0x33f4c5f1 0x33f4aad3 0x33f4a4c1 0x33f3083d 0x33f300e3 0x326e822b 0x37858523 0x378584c5 0x37857313 0x377da4a5 0x377da36d 0x326e7439 0x33f5ee7d 0x25f7 0x25b0)

    Thread 0 name:  Dispatch queue: com.apple.main-thread
    Thread 0 Crashed:
    0   libsystem_kernel.dylib          0x35d0332c 0x35cf2000 + 70444
    1   libsystem_c.dylib               0x31e51208 0x31e04000 + 315912
    2   libsystem_c.dylib               0x31e4a298 0x31e04000 + 287384
    3   libc++abi.dylib                 0x35456f64 0x35450000 + 28516
    4   libc++abi.dylib                 0x35454346 0x35450000 + 17222
    5   libobjc.A.dylib                 0x35d8a350 0x35d81000 + 37712
    6   libc++abi.dylib                 0x354543be 0x35450000 + 17342
    7   libc++abi.dylib                 0x3545444a 0x35450000 + 17482
    8   libc++abi.dylib                 0x3545581e 0x35450000 + 22558
    9   libobjc.A.dylib                 0x35d8a2a2 0x35d81000 + 37538
    10  CoreFoundation                  0x377da506 0x377cb000 + 62726
    11  CoreFoundation                  0x377da366 0x377cb000 + 62310
    12  GraphicsServices                0x326e7432 0x326e3000 + 17458
    13  UIKit                           0x33f5ee76 0x33f2d000 + 204406
    14  MyApp                           0x000025f0 0x1000 + 5616
    15  MyApp                           0x000025a8 0x1000 + 5544

當我在終端中調試崩潰報告時,

armv7 0x000025f0 main(在MyApp中)(main.m:14)

armv7 0x000025a8啟動(在MyApp中)+ 32

但是我不確定它的含義,請讓我知道它的含義

非常感謝你的幫助。

SIGABRT是最常見的崩潰類型。 例如,如果您正在運行iPhone 3gs,而客戶端使用的是更新的iPhone 4 / 4s,則可能要針對不同的體系結構(Armv6 / 7)進行編譯,請確保在這種情況下將其設置為Armv6,並且看起來像其中之一您使用的方法可能已被棄用。 在main.m中查找代碼。 在很多情況下,您必須使用iOS版本差異代碼(但大多數情況是針對iOS4 / iOS5)

我遇到了同樣的問題,我在應用程序中使用了核心數據,因此,如果您使用的是核心數據,也許這個答案將對您有所幫助,我通過更改persistentStoreCoordinator存儲代碼來修復了我的問題。

    ....
    - (NSPersistentStoreCoordinator *)persistentStoreCoordinator {

        if (persistentStoreCoordinator != nil) {
            return persistentStoreCoordinator;
        }

        NSURL *storeUrl = [NSURL fileURLWithPath:[[self applicationDocumentsDirectory] stringByAppendingFormat:@"yourdb.sqlite"]] ;
    ....

檢查這條線

NSURL *storeUrl = [NSURL fileURLWithPath:[[self applicationDocumentsDirectory] stringByAppendingFormat:@"yourdb.sqlite"]] ;

將上面的行更改為

NSURL *storeUrl = [NSURL fileURLWithPath:[[self applicationDocumentsDirectory] stringByAppendingPathComponent:@"yourdb.sqlite"]] ;

這就解決了我的問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM