UITextField 触摸时崩溃

发布于 2024-12-26 04:48:09 字数 3500 浏览 3 评论 0原文

当触摸默认类型的 UITextField 时,我们的 ios 应用程序会崩溃。 还有另一个 uitextfield 是数字键盘,它工作正常。

崩溃仅发生在 ios 5.0.1 上,ios 4.x 工作正常。

UITextField 是使用界面生成器创建的,我没有为其添加任何委托。

该项目是在 4.0.2 上创建的,我也在 4.2 上测试了相同的项目。

如果我创建一个新项目并在其中放入一个 UITextField 则没有问题。

不知何故,我的项目中的某些内容导致 UITextField 崩溃,我不知道如何调试它。

崩溃日志如下:

(gdb) bt
#0  0x33fa2fdc in CFRetain ()
#1  0x37991db6 in ___init_block_invoke_2 ()
#2  0x36c8e7ea in _dispatch_barrier_sync_f_invoke ()
#3  0x36c8e65a in dispatch_barrier_sync_f$VARIANT$up ()
#4  0x36c8e28e in dispatch_sync_f$VARIANT$up ()
#5  0x36c8e910 in dispatch_sync$VARIANT$up ()
#6  0x36c90576 in dispatch_once_f$VARIANT$up ()
#7  0x37992706 in CPLoggingAddCustomLogFile ()
#8  0x306ee658 in __MCLoggingInitialize_block_invoke_1 ()
#9  0x36c90576 in dispatch_once_f$VARIANT$up ()
#10 0x306ee6a4 in MCLoggingInitialize ()
#11 0x306ef060 in -[MCProfileConnection _init] ()
#12 0x306ef764 in +[MCProfileConnection sharedConnection] ()
#13 0x31758cce in _FTAreIDsEquivalent ()
#14 0x31758a46 in _FTAreIDsEquivalent ()
#15 0x317589c8 in _FTAreIDsEquivalent ()
#16 0x36c90576 in dispatch_once_f$VARIANT$up ()
#17 0x31758976 in _FTAreIDsEquivalent ()
#18 0x35026378 in GCC_except_table11 ()
#19 0x3504571c in _NSStringDescriptionForIMAVChatParticipantState ()
#20 0x350456a8 in _NSStringDescriptionForIMAVChatParticipantState ()
#21 0x36c90576 in dispatch_once_f$VARIANT$up ()
#22 0x35045656 in _NSStringDescriptionForIMAVChatParticipantState ()
#23 0x377931e2 in -[UIDictationController init] ()
#24 0x37793350 in +[UIDictationController sharedInstance] ()
#25 0x37793590 in +[UIDictationController fetchCurrentInputModeSupportsDictation] ()
#26 0x376b21d0 in -[UIKeyboardLayoutStar shouldShowDictationKey] ()
#27 0x374f4138 in -[UIKeyboardLayoutStar updateMoreAndInternationalKeys] ()
#28 0x374f206e in -[UIKeyboardLayoutStar setKeyplaneName:] ()
#29 0x374f0e62 in -[UIKeyboardLayoutStar showKeyboardType:appearance:orientation:withShift:] ()
#30 0x37481bc4 in -[UIKeyboardImpl updateLayout] ()
#31 0x37425f6a in -[UIKeyboardImpl setDelegate:force:] ()
#32 0x37407f22 in -[UIPeripheralHost(UIKitInternal) _reloadInputViewsForResponder:] ()
#33 0x37407c6e in -[UIResponder(UIResponderInputViewAdditions) reloadInputViews] ()
#34 0x374077aa in -[UIResponder becomeFirstResponder] ()
#35 0x37505d76 in -[UITextInteractionAssistant setFirstResponderIfNecessary] ()
#36 0x37505640 in -[UITextInteractionAssistant oneFingerTap:] ()
#37 0x37504f06 in _UIGestureRecognizerSendActions ()
#38 0x37496c1c in -[UIGestureRecognizer _updateGestureWithEvent:] ()
#39 0x376c2508 in ___UIGestureRecognizerUpdate_block_invoke_0541 ()
#40 0x37411d68 in _UIGestureRecognizerApplyBlocksToArray ()
#41 0x374108b6 in _UIGestureRecognizerUpdate ()
#42 0x3741d3cc in _UIGestureRecognizerUpdateGesturesFromSendEvent ()
#43 0x3741d20e in -[UIWindow _sendGesturesForEvent:] ()
#44 0x3741cddc in -[UIWindow sendEvent:] ()
#45 0x374034ec in -[UIApplication sendEvent:] ()
#46 0x37402d2c in _UIApplicationHandleEvent ()
#47 0x30835df2 in PurpleEventCallback ()
#48 0x3402e552 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#49 0x3402e4f4 in __CFRunLoopDoSource1 ()
#50 0x3402d342 in __CFRunLoopRun ()
#51 0x33fb04dc in CFRunLoopRunSpecific ()
#52 0x33fb03a4 in CFRunLoopRunInMode ()
#53 0x30834fcc in GSEventRunModal ()
#54 0x37431742 in UIApplicationMain ()
#55 0x00002462 in main (argc=1, argv=0x2fdffb04) at /Users/xxxx/Desktop/ios5/

Our ios application crashes when a UITextField with default type is touched.
There is another uitextfield which is numpad and it works okay.

The crash only occurs on ios 5.0.1 and ios 4.x works okay.

The UITextField is created with interface builder and I didn't add any delegates for it.

The project was created on 4.0.2 and I also tested the same project on 4.2.

If I create a new project and just put a UITextField in it there is no problem.

Somehow something in my project causes the UITextField to crash and I don't have any idea how to debug it.

The crash log is like following:

(gdb) bt
#0  0x33fa2fdc in CFRetain ()
#1  0x37991db6 in ___init_block_invoke_2 ()
#2  0x36c8e7ea in _dispatch_barrier_sync_f_invoke ()
#3  0x36c8e65a in dispatch_barrier_sync_f$VARIANT$up ()
#4  0x36c8e28e in dispatch_sync_f$VARIANT$up ()
#5  0x36c8e910 in dispatch_sync$VARIANT$up ()
#6  0x36c90576 in dispatch_once_f$VARIANT$up ()
#7  0x37992706 in CPLoggingAddCustomLogFile ()
#8  0x306ee658 in __MCLoggingInitialize_block_invoke_1 ()
#9  0x36c90576 in dispatch_once_f$VARIANT$up ()
#10 0x306ee6a4 in MCLoggingInitialize ()
#11 0x306ef060 in -[MCProfileConnection _init] ()
#12 0x306ef764 in +[MCProfileConnection sharedConnection] ()
#13 0x31758cce in _FTAreIDsEquivalent ()
#14 0x31758a46 in _FTAreIDsEquivalent ()
#15 0x317589c8 in _FTAreIDsEquivalent ()
#16 0x36c90576 in dispatch_once_f$VARIANT$up ()
#17 0x31758976 in _FTAreIDsEquivalent ()
#18 0x35026378 in GCC_except_table11 ()
#19 0x3504571c in _NSStringDescriptionForIMAVChatParticipantState ()
#20 0x350456a8 in _NSStringDescriptionForIMAVChatParticipantState ()
#21 0x36c90576 in dispatch_once_f$VARIANT$up ()
#22 0x35045656 in _NSStringDescriptionForIMAVChatParticipantState ()
#23 0x377931e2 in -[UIDictationController init] ()
#24 0x37793350 in +[UIDictationController sharedInstance] ()
#25 0x37793590 in +[UIDictationController fetchCurrentInputModeSupportsDictation] ()
#26 0x376b21d0 in -[UIKeyboardLayoutStar shouldShowDictationKey] ()
#27 0x374f4138 in -[UIKeyboardLayoutStar updateMoreAndInternationalKeys] ()
#28 0x374f206e in -[UIKeyboardLayoutStar setKeyplaneName:] ()
#29 0x374f0e62 in -[UIKeyboardLayoutStar showKeyboardType:appearance:orientation:withShift:] ()
#30 0x37481bc4 in -[UIKeyboardImpl updateLayout] ()
#31 0x37425f6a in -[UIKeyboardImpl setDelegate:force:] ()
#32 0x37407f22 in -[UIPeripheralHost(UIKitInternal) _reloadInputViewsForResponder:] ()
#33 0x37407c6e in -[UIResponder(UIResponderInputViewAdditions) reloadInputViews] ()
#34 0x374077aa in -[UIResponder becomeFirstResponder] ()
#35 0x37505d76 in -[UITextInteractionAssistant setFirstResponderIfNecessary] ()
#36 0x37505640 in -[UITextInteractionAssistant oneFingerTap:] ()
#37 0x37504f06 in _UIGestureRecognizerSendActions ()
#38 0x37496c1c in -[UIGestureRecognizer _updateGestureWithEvent:] ()
#39 0x376c2508 in ___UIGestureRecognizerUpdate_block_invoke_0541 ()
#40 0x37411d68 in _UIGestureRecognizerApplyBlocksToArray ()
#41 0x374108b6 in _UIGestureRecognizerUpdate ()
#42 0x3741d3cc in _UIGestureRecognizerUpdateGesturesFromSendEvent ()
#43 0x3741d20e in -[UIWindow _sendGesturesForEvent:] ()
#44 0x3741cddc in -[UIWindow sendEvent:] ()
#45 0x374034ec in -[UIApplication sendEvent:] ()
#46 0x37402d2c in _UIApplicationHandleEvent ()
#47 0x30835df2 in PurpleEventCallback ()
#48 0x3402e552 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#49 0x3402e4f4 in __CFRunLoopDoSource1 ()
#50 0x3402d342 in __CFRunLoopRun ()
#51 0x33fb04dc in CFRunLoopRunSpecific ()
#52 0x33fb03a4 in CFRunLoopRunInMode ()
#53 0x30834fcc in GSEventRunModal ()
#54 0x37431742 in UIApplicationMain ()
#55 0x00002462 in main (argc=1, argv=0x2fdffb04) at /Users/xxxx/Desktop/ios5/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

满意归宿 2025-01-02 04:48:09

更改“产品名称”

我遇到了完全相同的问题。我已经通过更改目标构建设置上的“产品名称”属性解决了这个问题。看起来像有非美国字符,特殊字符,如“ü、ğ、ç”等,会增加您的申请。

我完全不知道为什么这会产生这样的问题。但是将产品名称设置为“Ocu”而不是“Öcü”可以解决此问题。

我在另一个问题的答案中找到了此信息,这里是链接

Change "Product Name"

I had exactly same problem. I've solved it with changing "Product Name" property on build settings of target. Looks like having Non-USA characters, special characters like "ü, ğ, ç" etc. masses up your application.

I've absolutely no idea why this creates a problem such. But making product name something like "Ocu" instead of "Öcü" fixes it.

I found about this information on another question's answer and here is the link.

白日梦 2025-01-02 04:48:09

确保在界面生成器中 UITextField 没有任何当前出口。复制现有的 UITextFields 并且没有意识到它们之前链接到其他渠道或引用不再存在的内容是一种常见的事故。

Make sure in interface builder that the UITextField does not have any current outlets. It's a common mishap to duplicate existing UITextFields and not realize that they were previously linked to other outlets or making references to things that are no longer there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文