我对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收到相同或相似的异常?