我对 TestFlight SDK 有一个奇怪的问题。在 iPhone5 上我得到这个异常,应用程序崩溃了。
这是回溯:
Reason: -[__NSArrayM length]: unrecognized selector sent to instance 0x20c76d80
UserInfo: (null)
Backtrace: (0x3abbc2a3 0x34aab97f 0x3abbfe07 0x3abbe531 0x3ab15f68 0x3591b0c1 0x996eb 0xb2b83 0x97b21 0x973ed 0x75913 0x83657 0x839e7 0x38eaf11f 0x38eb3961 0x38eb3ac1 0x35c18a11 0x35c188a4)
Stack symbols: (
0 CoreFoundation 0x3abbc2bb <redacted> + 186
1 libobjc.A.dylib 0x34aab97f objc_exception_throw + 30
2 CoreFoundation 0x3abbfe07 <redacted> + 170
3 CoreFoundation 0x3abbe531 <redacted> + 392
4 CoreFoundation 0x3ab15f68 _CF_forwarding_prep_0 + 24
5 Foundation 0x3591b0c1 <redacted> + 160
6 FlyerApp 0x000996eb +[TFAirTrafficController logPath] + 102
7 FlyerApp 0x000b2b83 -[TFMessagePackLogOperation writeLogData] + 50
8 FlyerApp 0x00097b21 TFLogv + 92
9 FlyerApp 0x000973ed TFLog + 60
10 FlyerApp 0x00075913 -[KFRemoteLoadManager changesRequestFromDate:forDelegate:] + 834
11 FlyerApp 0x00083657 -[KFSyncManager _startSync] + 574
12 FlyerApp 0x000839e7 __31-[KFSyncManager tryToStartSync]_block_invoke_0132 + 54
13 libdispatch.dylib 0x38eaf11f <redacted> + 10
14 libdispatch.dylib 0x38eb3961 <redacted> + 252
15 libdispatch.dylib 0x38eb3ac1 <redacted> + 84
16 libsystem_c.dylib 0x35c18a11 <redacted> + 360
17 libsystem_c.dylib 0x35c188a4 start_wqthread + 8
)
我建议接下来是导致此异常的代码:
NSString *urlString = [NSString stringWithFormat:BASE_URL, [[KFLocalDataManager sharedManager] serverName]];
urlString = [[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] stringByAppendingString:methodName];
NSURL *url = [NSURL URLWithString:urlString];
TTLog(@"Request URL - '%@'", url);
TTLog 在哪里
#define TTLog(__FORMAT__, ...) TFLog((@"%s [Line %d] " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
url 字符串是服务器的 url,如下所示:
https://xxxxxx.xxxxxxx.com/xxxxx_xxxx/xxxx
这个错误不是每次都发生,而是总是在这个地方发生。我有几次崩溃,但我看不到所有相同崩溃问题的类似环境。此外,此代码在非主应用程序线程中运行,有时在 iOS 后台运行。
也许 TFLog 对传入参数有一些限制,或者有人收到与 TestFlight 相同或类似的异常?