2012-02-20 28 views
1

DialogViewController包含EntryElement和RefreshRequested處理程序(請參閱下面的代碼)。 運行在模擬器的調試模式下,在EntryElement中輸入一些快速隨機文本(包含空格)。隨後會出現崩潰。輸入文本時出現RefreshRequest和EntryElement崩潰的DialogViewController

我做錯了什麼?

我想這是DialogViewController中的一個錯誤,它不保留一些垃圾收集的圖像。 是否有切換到跟蹤垃圾回收器和刪除對象?

違規代碼:

[Register ("AppDelegate")] 
public partial class AppDelegate : UIApplicationDelegate 
{ 
    // class-level declarations 
    UIWindow window; 
    UINavigationController navController; 
    DialogViewController dv ; 


    public override bool FinishedLaunching (UIApplication app, NSDictionary options) 
    { 
     // create a new window instance based on the screen size 
     window = new UIWindow (UIScreen.MainScreen.Bounds); 

     navController = new UINavigationController(); 
     var root = new RootElement("Test") { 
      new Section("Quick type some text") { 
       new EntryElement("that contains spaces", string.Empty, string.Empty) 
      } 
     }; 

     dv = new DialogViewController(root, true); 
     dv.RefreshRequested += HandleDvRefreshRequested; // comment this line fixes the bug 
     window.MakeKeyAndVisible(); 


     if (UIDevice.CurrentDevice.CheckSystemVersion (5, 0)) { 
      window.RootViewController = navController; 
     } else { 
      window.AddSubview (navController.View); 
     } 

     return true; 
    } 

    void HandleDvRefreshRequested (object sender, EventArgs e) 
    { 
     dv.ReloadComplete(); 
    } 
} 
 

    Starting iOS simulator 5.0 
    Launching application 
    Application launched. PID = 4730 
    Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll [External] 
    Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll [External] 
    Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/System.dll [External] 
    Thread started: 
    Loaded assembly: /Users/user/Documents/iphone-cinetoile/Cinetoile.UI2/bin/iPhoneSimulator/Debug/MyApp.exe 
    Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/MonoTouch.Dialog-1.dll [External] 
    Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/Mono.Security.dll [External] 
    Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll [External] 

Stacktrace: 

    at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) 
    at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x00042] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:29 
    at MyApp.Application.Main (string[]) [0x00000] in /Users/user/Documents/MyApp/Main.cs:17 
    at (wrapper runtime-invoke) .runtime_invoke_void_object (object,intptr,intptr,intptr) 

本地堆棧跟蹤:

0 MyApp        0x000908ec mono_handle_native_sigsegv + 284 
1 MyApp        0x00005c88 mono_sigsegv_signal_handler + 248 
2 libSystem.B.dylib     0x9141905b _sigtramp + 43 
3 ???         0xffffffff 0x0 + 4294967295 
4 ???         0x92c013ef 0x0 + 2462061551 
5 ???         0x92c011ee 0x0 + 2462061038 
6 ???         0x987a313c 0x0 + 2558144828 
7 CoreGraphics      0x91b49e20 CGDataProviderRetain + 22 
8 ???         0x9880c456 0x0 + 2558575702 
9 ImageIO        0x9754a0d2 CGImageReadCreateWithProvider + 185 
10 ImageIO        0x97549fee CGImageSourceCreateWithDataProvider + 186 
11 CoreGraphics      0x013c0d2f CGImageCreateWithPNGDataProvider + 87 
12 WebCore        0x073ca2a5 WKGraphicsCreateImageFromBundleWithName + 373 
13 WebCore        0x06c1c5bd _ZN7WebCore15GraphicsContext23drawLineForTextCheckingERKNS_10FloatPointEfNS0_21TextCheckingLineStyleE + 369 
14 WebCore        0x06cf6e84 _ZN7WebCore13InlineTextBox28paintSpellingOrGrammarMarkerEPNS_15GraphicsContextERKNS_10FloatPointERKNS_14DocumentMarkerEPNS_11RenderStyleERKNS_4FontEb + 1684 
15 WebCore        0x06cf6fb9 _ZN7WebCore13InlineTextBox20paintDocumentMarkersEPNS_15GraphicsContextERKNS_10FloatPointEPNS_11RenderStyleERKNS_4FontEb + 297 
16 WebCore        0x06cf33fc _ZN7WebCore13InlineTextBox5paintERNS_9PaintInfoEiiii + 6490 
17 WebCore        0x06cec3cd _ZN7WebCore13InlineFlowBox5paintERNS_9PaintInfoEiiii + 1065 
18 WebCore        0x0724d24c _ZN7WebCore13RootInlineBox5paintERNS_9PaintInfoEiiii + 64 
19 WebCore        0x071a8e2a _ZNK7WebCore17RenderLineBoxList5paintEPNS_20RenderBoxModelObjectERNS_9PaintInfoEii + 638 
20 WebCore        0x07142089 _ZN7WebCore11RenderBlock11paintObjectERNS_9PaintInfoEii + 369 
21 WebCore        0x0714248f _ZN7WebCore11RenderBlock5paintERNS_9PaintInfoEii + 307 
22 WebCore        0x07141615 _ZN7WebCore11RenderBlock13paintChildrenERNS_9PaintInfoEii + 467 
23 WebCore        0x071420ab _ZN7WebCore11RenderBlock11paintObjectERNS_9PaintInfoEii + 403 
24 WebCore        0x0714248f _ZN7WebCore11RenderBlock5paintERNS_9PaintInfoEii + 307 
25 WebCore        0x07141615 _ZN7WebCore11RenderBlock13paintChildrenERNS_9PaintInfoEii + 467 
26 WebCore        0x071420ab _ZN7WebCore11RenderBlock11paintObjectERNS_9PaintInfoEii + 403 
27 WebCore        0x0714248f _ZN7WebCore11RenderBlock5paintERNS_9PaintInfoEii + 307 
28 WebCore        0x07141615 _ZN7WebCore11RenderBlock13paintChildrenERNS_9PaintInfoEii + 467 
29 WebCore        0x071420ab _ZN7WebCore11RenderBlock11paintObjectERNS_9PaintInfoEii + 403 
30 WebCore        0x0714248f _ZN7WebCore11RenderBlock5paintERNS_9PaintInfoEii + 307 
31 WebCore        0x071961b0 _ZN7WebCore11RenderLayer10paintLayerEPS0_PNS_15GraphicsContextERKNS_7IntRectEjPNS_12RenderObjectEPN3WTF7HashMapIPNS_24OverlapTestRequestClientES4_NS9_7PtrHashISC_EENS9_10HashTraitsISC_EENSF_IS4_EEEEj + 3684 
32 WebCore        0x0719648c _ZN7WebCore11RenderLayer10paintLayerEPS0_PNS_15GraphicsContextERKNS_7IntRectEjPNS_12RenderObjectEPN3WTF7HashMapIPNS_24OverlapTestRequestClientES4_NS9_7PtrHashISC_EENS9_10HashTraitsISC_EENSF_IS4_EEEEj + 4416 
33 WebCore        0x071973bb _ZN7WebCore11RenderLayer5paintEPNS_15GraphicsContextERKNS_7IntRectEjPNS_12RenderObjectE + 101 
34 WebCore        0x06bef809 _ZN7WebCore9FrameView13paintContentsEPNS_15GraphicsContextERKNS_7IntRectE + 591 
35 WebKit        0x067a51d0 -[WebFrame(WebInternal) _drawRect:contentsOnly:] + 368 
36 WebKit        0x067cc83c -[WebHTMLView drawSingleRect:] + 124 
37 WebKit        0x067cc786 -[WebHTMLView drawRect:] + 118 
38 WebCore        0x07392c2f _ZL12drawCallbackP6WKView6CGRectPv + 95 
39 WebCore        0x073cd52c _ZL11_WKViewDrawP9CGContextP6WKView6CGRectb + 492 
40 WebCore        0x073cd61f _ZL11_WKViewDrawP9CGContextP6WKView6CGRectb + 735 
41 WebCore        0x073cd61f _ZL11_WKViewDrawP9CGContextP6WKView6CGRectb + 735 
42 WebCore        0x073cd61f _ZL11_WKViewDrawP9CGContextP6WKView6CGRectb + 735 
43 WebCore        0x073cd61f _ZL11_WKViewDrawP9CGContextP6WKView6CGRectb + 735 
44 WebCore        0x073cd80e WKViewDisplayRect + 158 
45 WebCore        0x073cead0 WKWindowDrawRect + 48 
46 WebCore        0x0735daf0 _ZN7WebCore9TileCache9drawLayerEP9TileLayerP9CGContext + 880 
47 WebCore        0x07362af1 -[TileLayer drawInContext:] + 49 
48 QuartzCore       0x0417212d _ZL16backing_callbackP9CGContextPv + 88 
49 QuartzCore       0x0409215d CABackingStoreUpdate_ + 2636 
50 QuartzCore       0x04171fd2 _ZN2CA5Layer8display_Ev + 1370 
51 QuartzCore       0x0415fcf1 -[CALayer _display] + 33 
52 QuartzCore       0x04166281 _ZN2CA5Layer7displayEv + 165 
53 QuartzCore       0x0415fd17 -[CALayer display] + 33 
54 QuartzCore       0x04169c5c _ZN2CA5Layer17display_if_neededEPNS_11TransactionE + 256 
55 QuartzCore       0x040effb9 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 395 
56 QuartzCore       0x040f1ea6 _ZN2CA11Transaction6commitEv + 374 
57 QuartzCore       0x040f1580 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 80 
58 CoreFoundation      0x011959ce __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30 
59 CoreFoundation      0x0112c670 __CFRunLoopDoObservers + 384 
60 CoreFoundation      0x010f84f6 __CFRunLoopRun + 1174 
61 CoreFoundation      0x010f7db4 CFRunLoopRunSpecific + 212 
62 CoreFoundation      0x010f7ccb CFRunLoopRunInMode + 123 
63 GraphicsServices     0x04789879 GSEventRunModal + 207 
64 GraphicsServices     0x0478993e GSEventRun + 114 
65 UIKit        0x02190a9b UIApplicationMain + 1175 
66 ???         0x0cda47fd 0x0 + 215631869 
67 ???         0x0cc78ea0 0x0 + 214404768 
68 ???         0x0cc78b98 0x0 + 214403992 
69 ???         0x0cc78cee 0x0 + 214404334 
70 MyApp        0x00009ff2 mono_jit_runtime_invoke + 722 
71 MyApp        0x00169eee mono_runtime_invoke + 126 
72 MyApp        0x0016dfd4 mono_runtime_exec_main + 420 
73 MyApp        0x001733f5 mono_runtime_run_main + 725 
74 MyApp        0x000671f5 mono_jit_exec + 149 
75 MyApp        0x002116c9 main + 2825 
76 MyApp        0x00003045 start + 53 
 

    ================================================================= 
    Got a SIGSEGV while executing native code. This usually indicates 
    a fatal error in the mono runtime or one of the native libraries 
    used by your application. 
    ================================================================= 

+0

錯誤已經報告爲https://bugzilla.xamarin.com/show_bug.cgi?id=3538 – poupou 2012-02-20 12:53:41

+0

是的,我認爲它在這裏有更大的知名度。 – LukeSkywalker 2012-02-20 14:22:49

回答

1

它的Autocorrection反擊的情況下,也稱爲BUG#325(也有不少重複),它是not M onoTouch specific

有些東西,內心深處,模擬的iOS會被損壞並顯示出來,而它想要畫出它的小紅線來顯示某些拼寫錯誤。

這將只有發生在模擬器中,並且只有當UITextField已啓用自動糾正。關閉它是這樣的:

new EntryElement("that contains spaces", string.Empty, string.Empty) { 
    AutocorrectionType = UITextAutocorrectionType.No 
} 

將解決這一問題(你可以做到這一點只爲您的模擬器建立了#define)。

+0

該死的,你是唯一!十分感謝 ! – LukeSkywalker 2012-02-20 21:53:05