c# - Xamarin.IOS: UITableViewSource crashes on device -
i've simple app contains uitableview , uitableviewsource..
when using uitableview without linking uitableviewsource (the app works in simulator & device)
but when link uitableview uitableviewsource (the app works in simulator crashes on device)
( device ipad running ios 9.2.1 )
it gives me long error:
2016-02-08 05:16:02.913 secondapp[4487:1711787] critical: stacktrace: 2016-02-08 05:16:02.913 secondapp[4487:1711787] critical: @ <unknown> <0xffffffff> 2016-02-08 05:16:02.915 secondapp[4487:1711787] critical: @ (wrapper managed-to-native) uikit.uiapplication.uiapplicationmain (int,string[],intptr,intptr) <0xffffffff> 2016-02-08 05:16:02.915 secondapp[4487:1711787] critical: @ uikit.uiapplication.main (string[],intptr,intptr) [0x00005] in /users/builder/data/lanes/2689/962a0506/source/maccore/src/uikit/uiapplication.cs:77 2016-02-08 05:16:02.916 secondapp[4487:1711787] critical: @ uikit.uiapplication.main (string[],string,string) [0x0001c] in /users/builder/data/lanes/2689/962a0506/source/maccore/src/uikit/uiapplication.cs:60 2016-02-08 05:16:02.916 secondapp[4487:1711787] critical: @ secondapp.application.main (string[]) [0x00008] in /users/mujtaba/desktop/xamarinprojects/secondapp/secondapp/main.cs:12 2016-02-08 05:16:02.917 secondapp[4487:1711787] critical: @ (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff> 2016-02-08 05:16:02.917 secondapp[4487:1711787] critical: native stacktrace: 2016-02-08 05:16:02.982 secondapp[4487:1711787] critical: 0 secondapp 0x0027ffb5 mono_handle_native_sigsegv + 240 2016-02-08 05:16:02.982 secondapp[4487:1711787] critical: 1 secondapp 0x00286243 mono_sigsegv_signal_handler + 226 2016-02-08 05:16:02.983 secondapp[4487:1711787] critical: 2 libsystem_platform.dylib 0x20f3385f _sigtramp + 42 2016-02-08 05:16:02.983 secondapp[4487:1711787] critical: 3 secondapp 0x00323310 xamarin_stret_trampoline + 96 2016-02-08 05:16:02.984 secondapp[4487:1711787] critical: 4 uikit 0x25479d29 <redacted> + 2976 2016-02-08 05:16:02.984 secondapp[4487:1711787] critical: 5 uikit 0x2547907b <redacted> + 378 2016-02-08 05:16:02.984 secondapp[4487:1711787] critical: 6 uikit 0x25478e2d <redacted> + 56 2016-02-08 05:16:02.985 secondapp[4487:1711787] critical: 7 uikit 0x25478c33 <redacted> + 314 2016-02-08 05:16:02.985 secondapp[4487:1711787] critical: 8 uikit 0x256d4293 <redacted> + 42 2016-02-08 05:16:02.985 secondapp[4487:1711787] critical: 9 uikit 0x2547f295 <redacted> + 128 2016-02-08 05:16:02.986 secondapp[4487:1711787] critical: 10 uikit 0x25391369 <redacted> + 1480 2016-02-08 05:16:02.986 secondapp[4487:1711787] critical: 11 uikit 0x253b5fd5 <redacted> + 68 2016-02-08 05:16:02.986 secondapp[4487:1711787] critical: 12 uikit 0x253910ab <redacted> + 778 2016-02-08 05:16:02.987 secondapp[4487:1711787] critical: 13 uikit 0x253907ed <redacted> + 124 2016-02-08 05:16:02.987 secondapp[4487:1711787] critical: 14 uikit 0x2539069b <redacted> + 426 2016-02-08 05:16:02.987 secondapp[4487:1711787] critical: 15 uikit 0x2539d713 <redacted> + 1658 2016-02-08 05:16:02.987 secondapp[4487:1711787] critical: 16 uikit 0x2539d08f <redacted> + 30 2016-02-08 05:16:02.988 secondapp[4487:1711787] critical: 17 uikit 0x2539c87d <redacted> + 496 2016-02-08 05:16:02.988 secondapp[4487:1711787] critical: 18 uikit 0x25399bf3 <redacted> + 278 2016-02-08 05:16:02.988 secondapp[4487:1711787] critical: 19 uikit 0x2540e915 <redacted> + 48 2016-02-08 05:16:02.989 secondapp[4487:1711787] critical: 20 uikit 0x2563311d <redacted> + 3320 2016-02-08 05:16:02.989 secondapp[4487:1711787] critical: 21 uikit 0x25636f0f <redacted> + 1570 2016-02-08 05:16:02.989 secondapp[4487:1711787] critical: 22 uikit 0x2564ac15 <redacted> + 36 2016-02-08 05:16:02.989 secondapp[4487:1711787] critical: 23 uikit 0x256343f7 <redacted> + 134 2016-02-08 05:16:02.990 secondapp[4487:1711787] critical: 24 frontboardservices 0x2250fc75 <redacted> + 232 2016-02-08 05:16:02.990 secondapp[4487:1711787] critical: 25 frontboardservices 0x2250ff61 <redacted> + 44 2016-02-08 05:16:02.990 secondapp[4487:1711787] critical: 26 corefoundation 0x211c1257 <redacted> + 14 2016-02-08 05:16:02.990 secondapp[4487:1711787] critical: 27 corefoundation 0x211c0e47 <redacted> + 454 2016-02-08 05:16:02.990 secondapp[4487:1711787] critical: 28 corefoundation 0x211bf1af <redacted> + 806 2016-02-08 05:16:02.991 secondapp[4487:1711787] critical: 29 corefoundation 0x21111bb9 cfrunlooprunspecific + 516 2016-02-08 05:16:02.991 secondapp[4487:1711787] critical: 30 corefoundation 0x211119ad cfrunloopruninmode + 108 2016-02-08 05:16:02.991 secondapp[4487:1711787] critical: 31 uikit 0x25403a17 <redacted> + 526 2016-02-08 05:16:02.991 secondapp[4487:1711787] critical: 32 uikit 0x253fdfb5 uiapplicationmain + 144 2016-02-08 05:16:02.992 secondapp[4487:1711787] critical: 33 secondapp 0x000f4044 wrapper_managed_to_native_uikit_uiapplication_uiapplicationmain_int_string___intptr_intptr + 272 2016-02-08 05:16:02.992 secondapp[4487:1711787] critical: 34 secondapp 0x000bd130 uikit_uiapplication_main_string___intptr_intptr + 52 2016-02-08 05:16:02.992 secondapp[4487:1711787] critical: 35 secondapp 0x000bd0f0 uikit_uiapplication_main_string___string_string + 204 2016-02-08 05:16:02.992 secondapp[4487:1711787] critical: 36 secondapp 0x000b714c secondapp_application_main_string__ + 188 2016-02-08 05:16:02.992 secondapp[4487:1711787] critical: 37 secondapp 0x002101b4 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 256 2016-02-08 05:16:02.993 secondapp[4487:1711787] critical: 38 secondapp 0x0028888f mono_jit_runtime_invoke + 1150 2016-02-08 05:16:02.993 secondapp[4487:1711787] critical: 39 secondapp 0x002c71f5 mono_runtime_invoke + 88 2016-02-08 05:16:02.993 secondapp[4487:1711787] critical: 40 secondapp 0x002ca64b mono_runtime_exec_main + 282 2016-02-08 05:16:02.993 secondapp[4487:1711787] critical: 41 secondapp 0x00332fa4 xamarin_main + 2072 2016-02-08 05:16:02.994 secondapp[4487:1711787] critical: 42 secondapp 0x0025aac5 main + 112 2016-02-08 05:16:02.994 secondapp[4487:1711787] critical: 43 libdyld.dylib 0x20dc4873 <redacted> + 2 2016-02-08 05:16:02.994 secondapp[4487:1711787] critical: ================================================================= got sigsegv while executing native code. indicates fatal error in mono runtime or 1 of native libraries used application. =================================================================
all project contain 2 views :)
viewcontroller.cs :
using system; using uikit; namespace secondapp { public partial class viewcontroller : uiviewcontroller { public viewcontroller (intptr handle) : base (handle) { } public override void viewdidload () { base.viewdidload (); string[] list = new string[]{"red", "blue", "brown", "green" }; uitableview table = new uitableview { frame = new coregraphics.cgrect (0, 0, view.bounds.width, view.bounds.height), source = new mytablesource(list) // problem happens when add line }; view.addsubview (table); } public override void didreceivememorywarning () { base.didreceivememorywarning (); } } }
and mytablesource.cs :
using system; using uikit; namespace secondapp { public class mytablesource : uitableviewsource { string[] tableitems; string cellidentifier = "tablecell"; public mytablesource (string[] items) { tableitems = items; } public override nint rowsinsection (uitableview tableview, nint section) { return tableitems.length; } public override uitableviewcell getcell (uitableview tableview, foundation.nsindexpath indexpath) { uitableviewcell cell = tableview.dequeuereusablecell (cellidentifier); string item = tableitems[indexpath.row]; if (cell == null){ cell = new uitableviewcell (uitableviewcellstyle.default, cellidentifier); } cell.textlabel.text = item; return cell; } } }
hope there simple solution error, because still in first step in learning xamarin
thanks in advance ..
after week problem has gone itself, same solution works on same device ...
i did build -> clean all
.. maybe solved problem, or maybe problem solved waiting week
Comments
Post a Comment