[MonoTouch] Still IntPtr Constructor issues

Rolf Bjarne Kvinge rolf at xamarin.com
Wed Dec 7 17:09:07 EST 2011


Hi,

On Wed, Dec 7, 2011 at 9:03 PM, Rene Ruppert <rene.ruppert at googlemail.com>wrote:

>
> And there's one more thing I would like to add: If I put a breakpoint in
> SetSelected() of the cell I can see that it is called constantly (even for
> cells constructed without using the IntPtr) but the interesting thing is
> that the call stack is always pretty small and does not show where the call
> is coming from.
> It contains these two lines and that's it:
>
> MonoTouch.UIKit.UIApplication.Main (args={string[0]},
> principalClassName="UIApplicationMain",
> delegateClassName="AppDelegateIPad") in
>
> /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:29
> Browser.Application.Main (args={string[0]}) in
> /Users/Krumelur/Documents/Develop/.../Main.cs:15
>
> The problem here is that native (objc) frames aren't shown in the managed
stack trace.

To get native frames you can attach gdb while at the breakpoint. Get the
pid of the application (printed to the application output in MonoDevelop
when the app starts), and execute in a terminal:

gdb program <pid>
(gdb) bt
<you should now get a stack trace with native frames>
(gdb) quit

Unfortunately the native stack trace will not have managed frames  (1).

Rolf

(1) You can get information for managed frames in gdb, look at mono_pmip
here: http://www.mono-project.com/Debugging#Debugging_with_GDB



> So something seems to trigger it magically.
>
> René
>
> Am 07.12.2011 um 20:55 schrieb Rene Ruppert:
>
> Hi,
>
> I'm still struggling with the IntPtr Constructor issue I started on SO.
> I got a bit further meanwhile.
>
> The case is: I'm subclassing UITableViewCell and do not provide the
> IntPtr:ctor.
>
> By adding the ctor and breaking in there I figured out what ObjC wants my
> class to do: it is calling void SetSelected ( bool selected, boolanimated ).
>
> This means "something" wants to select my cell. I looked through my code
> and found exactly ONE place where I call SelectRow(). I commented that out
> and STILL it goes through the ctor and to SetSelected().
>
> What are my options now? Does UITableViewCell maybe always require the
> IntPtr ctor?
> What could possibly still select a row in a UITableView besides
> SelectRow()?
>
> René
>
>
>
> _______________________________________________
> MonoTouch mailing list
> MonoTouch at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monotouch/attachments/20111207/19a3f7d7/attachment.html 


More information about the MonoTouch mailing list