[Cocoa-sharp] Need help with View.cs

Todd Schavey schaveyt at gmail.com
Fri Mar 9 08:55:49 EST 2007


Geoff,

I'm trying to implement the following function in the View class:

public Point ConvertPointFromView( Point aPoint, View aView )
{
    return (Point) ObjCMessaging.objc_msgSend (
                NativeObject, "convertPoint:fromView:",
                typeof (Point),                                           //
return value type
                typeof (Point), aPoint,                               // 1st
arg
                typeof (IntPtr), aView.NativeObject );         // 2nd arg
}

But I get a SIGSEGV at runtime. Some things I've tried....Once I change the
return type to IntPtr

public Point ConvertPointFromView( Point aPoint, View aView )
{
    object lObject = Object.FromIntPtr( ObjCMessaging.objc_msgSend (
                NativeObject, "convertPoint:fromView:",
                typeof (Point),                                           //
return value type
                typeof (Point), aPoint,                               // 1st
arg
                typeof (IntPtr), aView.NativeObject ) );         // 2nd arg

    return new Point( 0, 0 );
}

The above gets rid of the SEGSEGV dump....but obvious I can't convert an
object to Point...as point is a struct...

Any thought?

Todd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/cocoa-sharp/attachments/20070309/6c1ab4f0/attachment.html 


More information about the Cocoa-sharp mailing list