簡體   English   中英

在模擬器中的模態控制器中鍵入UITextField時,應用程序會卡住

[英]App gets stuck when typing in UITextField in a modally presented controller in Simulator

我使用Monotouch 5.2.5在iPad模擬器5.0中以調試模式運行我的應用程序,這有一個非常非常奇怪的效果。

我在Interface Builder中構建了一個通用視圖控制器。 它有一個UITextField和一個UITextView

如果我在我的導航堆棧上推動該控制器,我可以正常使用它。 但是,如果我以模態方式呈現它,我可以在任一輸入字段中鍵入視圖字符,然后應用程序卡住。 沒有輸入,沒有崩潰,控制台日志中沒有任何內容。 它只是掛起。 這是每次都可重復的。

我在控制器的終結器中放了一個斷點:沒有被調用。 此外,如果我將另一個自定義控件添加到繼承自UITextField的控制器中,我可以使用那個沒有問題。

編輯:

  • 它只在模擬器上崩潰
  • 如果我在輸入字段上禁用自動校正 ,它在模擬器中工作!

這是GDB的輸出 - 但我不知道它能告訴我什么:

(gdb) thread apply all backtrace

Thread 11 (process 65850):
#0  0x97d30c76 in semaphore_timedwait_trap ()
#1  0x0020c185 in mono_sem_timedwait (sem=0x2f52c8, timeout_ms=2000, alertable=1) at mono-semaphore.c:76
#2  0x001cc404 in async_invoke_thread (data=0x0) at threadpool.c:1497
#3  0x001d1e16 in start_wrapper_internal [inlined] () at :784
#4  0x001d1e16 in start_wrapper (data=0x9c56770) at threads.c:832
#5  0x00203cfa in thread_start_routine (args=0xe222a70) at wthreads.c:287
#6  0x001aeb20 in gc_start_thread (arg=0x9c563a0) at sgen-gc.c:6196
#7  0x9c596ed9 in _pthread_start ()
#8  0x9c59a6de in thread_start ()

Thread 10 (process 65850):
#0  0x97d32bb2 in __semwait_signal ()
#1  0x9c54b7b9 in nanosleep$UNIX2003 ()
#2  0x00202ed7 in SleepEx (ms=500, alertable=1) at wthreads.c:1027
#3  0x001c92d7 in monitor_thread (unused=0x0) at threadpool.c:781
#4  0x001d1e16 in start_wrapper_internal [inlined] () at :784
#5  0x001d1e16 in start_wrapper (data=0x9c57180) at threads.c:832
#6  0x00203cfa in thread_start_routine (args=0xe2229f4) at wthreads.c:287
#7  0x001aeb20 in gc_start_thread (arg=0x9c56770) at sgen-gc.c:6196
#8  0x9c596ed9 in _pthread_start ()
#9  0x9c59a6de in thread_start ()

Thread 9 (process 65850):
#0  0x97d3283e in __psynch_cvwait ()
#1  0x9c59ae21 in _pthread_cond_wait ()
#2  0x9c54b42c in pthread_cond_wait$UNIX2003 ()
#3  0x001ef302 in _wapi_handle_timedwait_signal_handle (handle=0x10f, timeout=0x0, alertable=1, poll=0) at handles.c:1655
#4  0x001ef348 in _wapi_handle_wait_signal_handle (handle=0x10f, alertable=1) at handles.c:1598
#5  0x00200e58 in WaitForSingleObjectEx (handle=0x131, timeout=4294967295, alertable=1) at wait.c:203
#6  0x001d081d in ves_icall_System_Threading_WaitHandle_WaitOne_internal (this=0xc6a2ed8, handle=0x10f, ms=-1, exitContext=0) at threads.c:1665
#7  0x12f9bf7e in ?? ()
#8  0x12f9b9e4 in ?? ()
#9  0x12f9b4d3 in ?? ()
#10 0x12f99a40 in ?? ()
#11 0x12f972be in ?? ()
#12 0x099eaa50 in ?? ()
#13 0x00010222 in mono_jit_runtime_invoke (method=0xe356e14, obj=0xc6a2fb0, params=0xb06daf34, exc=0x0) at mini.c:5797
#14 0x00171f6e in mono_runtime_invoke (method=0xe356e14, obj=0xc6a2fb0, params=0xb06daf34, exc=0x0) at object.c:2757
#15 0x001720ac in mono_runtime_delegate_invoke (delegate=0xc6a2fb0, params=0xb06daf34, exc=0x0) at object.c:3422
#16 0x001d1e42 in start_wrapper_internal [inlined] () at :790
#17 0x001d1e42 in start_wrapper (data=0x9c58de0) at threads.c:832
#18 0x00203cfa in thread_start_routine (args=0xe222690) at wthreads.c:287
#19 0x001aeb20 in gc_start_thread (arg=0x9c587f0) at sgen-gc.c:6196
#20 0x9c596ed9 in _pthread_start ()
#21 0x9c59a6de in thread_start ()

Thread 8 (process 65850):
#0  0x97d32876 in __psynch_mutexwait ()
#1  0x9c5956af in pthread_mutex_lock ()
#2  0x073a955e in _WebTryThreadLock ()
#3  0x073a9255 in WebRunLoopLock ()
#4  0x011a99ce in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ ()
#5  0x01140670 in __CFRunLoopDoObservers ()
#6  0x0110c665 in __CFRunLoopRun ()
#7  0x0110bdb4 in CFRunLoopRunSpecific ()
#8  0x0110bccb in CFRunLoopRunInMode ()
#9  0x073a9220 in RunWebThread ()
#10 0x9c596ed9 in _pthread_start ()
#11 0x9c59a6de in thread_start ()

Thread 7 (process 65850):
#0  0x97d32bb2 in __semwait_signal ()
#1  0x9c54b7b9 in nanosleep$UNIX2003 ()
#2  0x9c54b558 in usleep$UNIX2003 ()
#3  0x0021c162 in monotouch_pump_gc ()
#4  0x9c596ed9 in _pthread_start ()
#5  0x9c59a6de in thread_start ()

Thread 6 (process 65850):
#0  0x97d32a9a in recvfrom$UNIX2003 ()
#1  0x9c54b4a2 in recv$UNIX2003 ()
#2  0x00227b41 in recv_uninterrupted ()
#3  0x00227c24 in sdb_recv ()
#4  0x000b005a in transport_recv [inlined] () at :1373
#5  0x000b005a in debugger_thread (arg=0x0) at debugger-agent.c:7799
#6  0x00203cfa in thread_start_routine (args=0xe22232c) at wthreads.c:287
#7  0x001aeb20 in gc_start_thread (arg=0x9c632d0) at sgen-gc.c:6196
#8  0x9c596ed9 in _pthread_start ()
#9  0x9c59a6de in thread_start ()

Thread 5 (process 65850):
#0  0x97d30c5e in semaphore_wait_trap ()
#1  0x0020c21a in mono_sem_wait (sem=Cannot access memory at address 0x0
) at mono-semaphore.c:115
#2  0x0011224a in finalizer_thread (unused=0x0) at gc.c:1070
#3  0x001d1e16 in start_wrapper_internal [inlined] () at :784
#4  0x001d1e16 in start_wrapper (data=0xdb72500) at threads.c:832
#5  0x00203cfa in thread_start_routine (args=0xe222234) at wthreads.c:287
#6  0x001aeb20 in gc_start_thread (arg=0xdb72550) at sgen-gc.c:6196
#7  0x9c596ed9 in _pthread_start ()
#8  0x9c59a6de in thread_start ()

Thread 4 (process 65850):
#0  0x97d30c22 in mach_msg_trap ()
#1  0x97d301f6 in mach_msg ()
#2  0x000de64a in mach_exception_thread (arg=0x0) at mini-darwin.c:132
#3  0x9c596ed9 in _pthread_start ()
#4  0x9c59a6de in thread_start ()

Thread 3 (process 65850):
#0  0x97d32a9a in recvfrom$UNIX2003 ()
#1  0x9c54b4a2 in recv$UNIX2003 ()
#2  0x00227b41 in recv_uninterrupted ()
#3  0x0022933b in monotouch_process_connection ()
#4  0x00228a17 in monotouch_connect_wifi ()
#5  0x002278b7 in monotouch_configure_debugging ()
#6  0x0022bd75 in -[CocoaThreadInitializer entryPoint:] ()
#7  0x017374e6 in -[NSThread main] ()
#8  0x01737457 in __NSThread__main__ ()
#9  0x9c596ed9 in _pthread_start ()
#10 0x9c59a6de in thread_start ()

Thread 2 (process 65850):
#0  0x97d3390a in kevent ()
#1  0x03784373 in _dispatch_mgr_invoke ()
#2  0x03782cd0 in _dispatch_mgr_thread ()

Thread 1 (process 65850):
#0  0x947e7d52 in ?? ()
#1  0x90154973 in CGDataProviderRetain ()
#2  0x9c80364a in CFAllocatorCreate ()
#3  0x9859a3d1 in CGImageReadCreateWithProvider ()
#4  0x9859a291 in CGImageSourceCreateWithDataProvider ()
#5  0x013d4d2f in CGImageCreateWithPNGDataProvider ()
#6  0x073de2a5 in WKGraphicsCreateImageFromBundleWithName ()
#7  0x06c305bd in WebCore::GraphicsContext::drawLineForTextChecking ()
#8  0x06d0ae84 in WebCore::InlineTextBox::paintSpellingOrGrammarMarker ()
#9  0x06d0afb9 in WebCore::InlineTextBox::paintDocumentMarkers ()
#10 0x06d073fc in WebCore::InlineTextBox::paint ()
#11 0x06d003cd in WebCore::InlineFlowBox::paint ()
#12 0x0726124c in WebCore::RootInlineBox::paint ()
#13 0x071bce2a in WebCore::RenderLineBoxList::paint ()
#14 0x07156089 in WebCore::RenderBlock::paintObject ()
#15 0x0715648f in WebCore::RenderBlock::paint ()
#16 0x07155615 in WebCore::RenderBlock::paintChildren ()
#17 0x071560ab in WebCore::RenderBlock::paintObject ()
#18 0x0715648f in WebCore::RenderBlock::paint ()
#19 0x071aa1b0 in WebCore::RenderLayer::paintLayer ()
#20 0x071aa48c in WebCore::RenderLayer::paintLayer ()
#21 0x071ab3bb in WebCore::RenderLayer::paint ()
#22 0x06c03809 in WebCore::FrameView::paintContents ()
#23 0x067b91d0 in -[WebFrame(WebInternal) _drawRect:contentsOnly:] ()
#24 0x067e083c in -[WebHTMLView drawSingleRect:] ()
#25 0x067e0786 in -[WebHTMLView drawRect:] ()
#26 0x073a6c2f in drawCallback ()
#27 0x073e152c in _WKViewDraw ()
#28 0x073e161f in _WKViewDraw ()
#29 0x073e161f in _WKViewDraw ()
#30 0x073e161f in _WKViewDraw ()
#31 0x073e161f in _WKViewDraw ()
#32 0x073e180e in WKViewDisplayRect ()
#33 0x073e2ad0 in WKWindowDrawRect ()
#34 0x07371af0 in WebCore::TileCache::drawLayer ()
#35 0x07376af1 in -[TileLayer drawInContext:] ()
#36 0x0418612d in backing_callback ()
#37 0x040a615d in CABackingStoreUpdate_ ()
#38 0x04185fd2 in CA::Layer::display_ ()
#39 0x04173cf1 in -[CALayer _display] ()
#40 0x0417a281 in CA::Layer::display ()
#41 0x04173d17 in -[CALayer display] ()
#42 0x0417dc5c in CA::Layer::display_if_needed ()
#43 0x04103fb9 in CA::Context::commit_transaction ()
#44 0x04105ea6 in CA::Transaction::commit ()
#45 0x04105580 in CA::Transaction::observer_callback ()
#46 0x011a99ce in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ ()
#47 0x01140670 in __CFRunLoopDoObservers ()
#48 0x0110c4f6 in __CFRunLoopRun ()
#49 0x0110bdb4 in CFRunLoopRunSpecific ()
#50 0x0110bccb in CFRunLoopRunInMode ()
#51 0x0479d879 in GSEventRunModal ()
#52 0x0479d93e in GSEventRun ()
#53 0x021a4a9b in UIApplicationMain ()
#54 0x0e9e018d in ?? ()
#55 0x0e9de930 in ?? ()
#56 0x0e9de608 in ?? ()
#57 0x0e9de77e in ?? ()
#58 0x00010222 in mono_jit_runtime_invoke (method=0xa3031e4, obj=0x0, params=0xbffff1d8, exc=0x0) at mini.c:5797
#59 0x00171f6e in mono_runtime_invoke (method=0xa3031e4, obj=0x0, params=0xbffff1d8, exc=0x0) at object.c:2757
#60 0x00176294 in mono_runtime_exec_main (method=0xa3031e4, args=0xc69be98, exc=0x0) at object.c:3932
#61 0x00176605 in mono_runtime_run_main (method=0xa3031e4, argc=0, argv=0x2dee80, exc=0x0) at object.c:3562
#62 0x0006b7f5 in mono_jit_exec (domain=0x9d616b0, assembly=0x986b2f0, argc=1, argv=0x2dee80) at driver.c:1122
#63 0x0022bcd0 in main ()

有沒有人知道這里會發生什么? 我現在會嘗試解決問題,但我仍然希望有人能指出我正確的方向。

是。 這是iOS模擬器的一個已知錯誤(與MonoTouch無關)。 解決方法是在模擬器中執行時禁用拼寫檢查(例如#if SIMULATOR)。

模擬器中的UITextField崩潰不在iPhone 4中(4.2)

你可以通過附加gdb並獲取所有線程的堆棧跟蹤來弄清楚應用程序在做什么:

gdb program <PID printed to application output on startup>
<gdb output>
(gdb) thread apply all backtrace
<more gdb output>

暫無
暫無

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

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