Preface:
* iPad project
* Single viewcontroller, which in turn contains a single UIWebView
* UIWebView class name is set to 'MyWebView'
* Project contains instance of 'MyWebView' class (source code below)
* Crash occurs – stack trace below
* Issue only occurs in iOS5 (beta 4 or 5). iOS 4 works fine.
Before you see the very simple, boilerplate code for MyWebView, the problem is
entirely resolved by omitting the following line:
[Export("initWithCoder:")]
Is there something strange with the ctor for initWithCoder: being exported for
UIWebView? Is this is known issue?
This is the child class that is causing the crash…
[MonoTouch.Foundation.Register("MyWebView")]
public class MyWebView : UIWebView
{
public MyWebView (IntPtr handle) : base(handle)
{
Initialize ();
}
public MyWebView(RectangleF frame) : base(frame)
{
Initialize();
}
[Export("initWithCoder:")]
public MyWebView (NSCoder coder) : base(coder)
{
Console.WriteLine("asd");
Initialize ();
}
void Initialize ()
{
}
#endregion
}
And this is the stack trace…
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: Stacktrace:
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: at MonoTouch.Foundation.NSObject.InitializeObject (bool) <0x00093>
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: at MonoTouch.Foundation.NSObject..ctor
(MonoTouch.Foundation.NSObjectFlag) <0x0002b>
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: at MonoTouch.UIKit.UIResponder..ctor
(MonoTouch.Foundation.NSObjectFlag) <0x00023>
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: at MonoTouch.UIKit.UIView..ctor (MonoTouch.Foundation.NSObjectFlag)
<0x00023>
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: at MonoTouch.UIKit.UIWebView..ctor (MonoTouch.Foundation.NSCoder)
<0x00033>
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: at CrashTest.MyWebView..ctor (MonoTouch.Foundation.NSCoder) <IL
0x00002, 0x00087>
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: at (wrapper runtime-invoke) object.runtime_invoke_dynamic
(intptr,intptr,intptr,intptr) <0xffffffff>
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: at MonoTouch.UIKit.UIViewController.get_View () <0x00097>
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: at CrashTest.AppDelegate.FinishedLaunching
(MonoTouch.UIKit.UIApplication,MonoTouch.Foundation.NSDictionary) [0x00006] in
/Users/stevem/Projects/CrashTest/CrashTest/Main.cs:28
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: at (wrapper runtime-invoke) object.runtime_invoke_dynamic
(intptr,intptr,intptr,intptr) <0xffffffff>
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: at MonoTouch.UIKit.UIApplication.Main (string[],string,string)
<0x000cf>
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: at MonoTouch.UIKit.UIApplication.Main (string[]) <0x00023>
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: at CrashTest.Application.Main (string[]) [0x00000] in
/Users/stevem/Projects/CrashTest/CrashTest/Main.cs:14
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: at (wrapper runtime-invoke) object.runtime_invoke_dynamic
(intptr,intptr,intptr,intptr) <0xffffffff>
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: Native stacktrace:
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 0 CrashTest 0x002022c0
mono_handle_native_sigsegv + 412
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 1 CrashTest 0x001e81a0
mono_sigsegv_signal_handler + 360
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 2 libsystem_c.dylib 0x3713a439 _sigtramp + 48
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 3 CrashTest 0x0035e8a4
monotouch_retain_trampoline + 48
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 4 CrashTest 0x0001fe34
wrapper_managed_to_native_MonoTouch_ObjCRuntime_Messaging_void_objc_msgSend_intptr_intptr
+ 68
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 5 CrashTest 0x00006954
MonoTouch_Foundation_NSObject__ctor_MonoTouch_Foundation_NSObjectFlag + 44
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 6 CrashTest 0x0000cb04
MonoTouch_UIKit_UIResponder__ctor_MonoTouch_Foundation_NSObjectFlag + 36
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 7 CrashTest 0x0000cbe0
MonoTouch_UIKit_UIView__ctor_MonoTouch_Foundation_NSObjectFlag + 36
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 8 CrashTest 0x0000d97c
MonoTouch_UIKit_UIWebView__ctor_MonoTouch_Foundation_NSCoder + 52
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 9 CrashTest 0x00003b68
CrashTest_MyWebView__ctor_MonoTouch_Foundation_NSCoder + 136
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 10 CrashTest 0x00160948
wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr
+ 200
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 11 CrashTest 0x001e7e08
mono_jit_runtime_invoke + 2800
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 12 CrashTest 0x002d6adc
mono_runtime_invoke + 140
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 13 CrashTest 0x0035d94c
monotouch_ctor_trampoline + 2948
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 14 UIKit 0x321572bf -[UIClassSwapper
initWithCoder:] + 218
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 15 Foundation 0x303a162b
_decodeObjectBinary + 2698
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 16 Foundation 0x303a53a7
-[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] + 1102
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 17 Foundation 0x303a4e2b -[NSArray(NSArray)
initWithCoder:] + 502
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 18 Foundation 0x303a162b
_decodeObjectBinary + 2698
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 19 Foundation 0x303a0a71 _decodeObject + 204
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 20 UIKit 0x3207f9f1 -[UIView
initWithCoder:] + 560
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 21 Foundation 0x303a162b
_decodeObjectBinary + 2698
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 22 Foundation 0x303a0a71 _decodeObject + 204
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 23 UIKit 0x32156ee5
-[UIRuntimeConnection initWithCoder:] + 152
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 24 Foundation 0x303a162b
_decodeObjectBinary + 2698
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 25 Foundation 0x303a53a7
-[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] + 1102
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 26 Foundation 0x303a4e2b -[NSArray(NSArray)
initWithCoder:] + 502
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 27 Foundation 0x303a162b
_decodeObjectBinary + 2698
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 28 Foundation 0x303a0a71 _decodeObject + 204
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 29 UIKit 0x32156671 -[UINib
instantiateWithOwner:options:] + 664
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 30 UIKit 0x320b2d8b -[UIViewController
_loadViewFromNibNamed:bundle:] + 246
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 31 UIKit 0x32066b7d -[UIViewController
loadView] + 88
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 32 UIKit 0x31f4a0b7 -[UIViewController
view] + 50
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 33 CrashTest 0x00020188
wrapper_managed_to_native_MonoTouch_ObjCRuntime_Messaging_IntPtr_objc_msgSendSuper_intptr_intptr
+ 68
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 34 CrashTest 0x00002c68
CrashTest_AppDelegate_FinishedLaunching_MonoTouch_UIKit_UIApplication_MonoTouch_Foundation_NSDictionary
+ 236
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 35 CrashTest 0x00160948
wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr
+ 200
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 36 CrashTest 0x001e7e08
mono_jit_runtime_invoke + 2800
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 37 CrashTest 0x002d6adc
mono_runtime_invoke + 140
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 38 CrashTest 0x0035c6cc
monotouch_trampoline + 2840
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 39 UIKit 0x31f25f23 -[UIApplication
_callInitializationDelegatesForURL:payload:suspended:] + 1186
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 40 UIKit 0x31f150ed -[UIApplication
_runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 396
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 41 UIKit 0x31f14039 -[UIApplication
handleEvent:withNewEvent:] + 1016
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 42 UIKit 0x31f13ad7 -[UIApplication
sendEvent:] + 54
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 43 UIKit 0x31f135f1
_UIApplicationHandleEvent + 5808
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 44 GraphicsServices 0x351e1efb
PurpleEventCallback + 882
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 45 CoreFoundation 0x3252f9cb
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 38
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 46 CoreFoundation 0x3252f96d
__CFRunLoopDoSource1 + 140
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 47 CoreFoundation 0x3252e593 __CFRunLoopRun +
1370
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 48 CoreFoundation 0x324d003d
CFRunLoopRunSpecific + 300
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 49 CoreFoundation 0x324cff05 CFRunLoopRunInMode
+ 104
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 50 UIKit 0x31f1175f -[UIApplication
_run] + 550
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 51 UIKit 0x31f0e991 UIApplicationMain
+ 1080
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 52 CrashTest 0x00021384
wrapper_managed_to_native_MonoTouch_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr
+ 240
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 53 CrashTest 0x0000c7ac
MonoTouch_UIKit_UIApplication_Main_string__ + 36
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 54 CrashTest 0x00002e7c
CrashTest_Application_Main_string__ + 128
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 55 CrashTest 0x00160948
wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr
+ 200
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 56 CrashTest 0x001e7e08
mono_jit_runtime_invoke + 2800
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 57 CrashTest 0x002d6adc
mono_runtime_invoke + 140
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 58 CrashTest 0x002d9a8c
mono_runtime_exec_main + 784
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 59 CrashTest 0x002d8af0
mono_runtime_run_main + 1048
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 60 CrashTest 0x001ef5b8 mono_jit_exec + 216
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 61 CrashTest 0x001e23e0 main + 3448
Aug 12 13:44:09 unknown UIKitApplication:com.lw.crashtest[0x2585][515]
<Notice>: 62 CrashTest 0x000027f0 start + 52
*******************************************************************************
To comply with IRS regulations, we advise you that any discussion of Federal
tax issues in this
e-mail was not intended or written to be used, and cannot be used by you, (i)
to avoid any penalties
imposed under the Internal Revenue Code or (ii) to promote, market or recommend
to another party any
transaction or matter addressed herein.
For more information please go to http://www.lw.com/docs/irs.pdf
*******************************************************************************
This email may contain material that is confidential, privileged and/or
attorney work product for
the sole use of the intended recipient. Any review, reliance or distribution
by others or forwarding
without express permission is strictly prohibited. If you are not the intended
recipient, please
contact the sender and delete all copies.
Latham & Watkins LLP
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch