最近在buggly上查看崩潰的時(shí)候,發(fā)現(xiàn)NSInternalInconsistencyException Shouldn't have translate session這樣的崩潰,不出意料,當(dāng)我點(diǎn)擊進(jìn)去查看詳情的時(shí)候,也是崩潰到了系統(tǒng)堆棧,然后嘗試百度和谷歌大法,發(fā)現(xiàn)屬于iOS15系統(tǒng)上的崩潰,暫時(shí)還沒(méi)有大佬給出修復(fù)方案,沒(méi)辦法只好自己分析和解決了。
一、崩潰堆棧
0 CoreFoundation ___exceptionPreprocess + 216
1 libobjc.A.dylib _objc_exception_throw + 56
2 Foundation__userInfoForFileAndLine
3 UIKitCore -[UITextInputController _translate:] + 404
4 UIKitCore -[UITextField _translate:] + 80
5 UIKitCore +[UIPasteboard _performAsDataOwnerForAction:responder:block:] + 204
6 UIKitCore -[UICalloutBar buttonPressed:] + 508
7 UIKit -[UICalloutBarAccessibility buttonPressed:] + 40
8 UIKitCore -[UICalloutBarButton fadeAndSendActionWithAuthenticationMessage:] + 304
9 Foundation ___NSFireDelayedPerform + 420
10 CoreFoundation ___CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
11 CoreFoundation ___CFRunLoopDoTimer + 1008
12 CoreFoundation___CFRunLoopDoTimers + 316
13 CoreFoundation___CFRunLoopRun + 1964
14 CoreFoundation_CFRunLoopRunSpecific + 572
15 GraphicsServices_GSEventRunModal + 160
16 UIKitCore-[UIApplication _run] + 1080
17 UIKitCore_UIApplicationMain + 336
18 homework main (main.m:39)
19 ??? 0x00000001040b0000 + 0
二、問(wèn)題分析
1、翻譯Shouldn't have translate session這個(gè)提示可以得出,當(dāng)前不支持翻譯功能
2、然后繼續(xù)查看堆棧有UITextField的關(guān)鍵字,說(shuō)明是UITextField不支持。
3、查閱相關(guān)功能代碼,然后找到buggly崩潰最多的系統(tǒng)版本嘗試復(fù)現(xiàn),我的運(yùn)氣好,復(fù)現(xiàn)了??,可以確認(rèn)是UITextField中的長(zhǎng)按翻譯導(dǎo)致的崩潰。
4、我在使用的時(shí)候,其實(shí)在iOS15.0的系統(tǒng)上是不會(huì)崩潰的,不知道為什么在15.4.1上為什么會(huì)崩潰
三、問(wèn)題解決
參考:iOS中的UITextField或UITextView的NSInternalInconsistencyException Shouldn't have translate session崩潰
個(gè)人獨(dú)立開(kāi)發(fā)的完全開(kāi)源的編程學(xué)習(xí)網(wǎng)站,跪求“注冊(cè)、點(diǎn)贊、評(píng)論 ”三連