Cocoa #

0 views
Skip to first unread message

alexon

unread,
Nov 21, 2007, 10:28:16 PM11/21/07
to cocoa-sharp-dev
Hello there,
I have a problem with the Cocoa.TextField.Value get property.
When I assign a string to the TextField control (set property) it
works OK.
But when I try to call get property , let say:
string someString = TextField.Value;
The application does not crash, the method wich executes currently
just stops.
Any help, will be appreciated.

Richard K

unread,
Nov 26, 2007, 6:43:50 PM11/26/07
to cocoa-sharp-dev
Hello,

You don't happen to have the TextField in a matrix of cells do you? I
ran into a problem with the Cell.Value getter method in Cell.cs - it
is defined incorrectly in my current version of cocoa-sharp (0.9.4).
It should be:

get {
return
Object.FromIntPtr((IntPtr)ObjCMessaging.objc_msgSend(NativeObject,
"stringValue", typeof(System.IntPtr))).ToString();
}

Note: the changes are 1) no colon after stringValue and change void to
IntPtr in the typeOf.

PS the Value getter in Control.cs which TextField inherits from is
correct -- but maybe worth a check in your copy of the source.

Richard

alexon

unread,
Nov 27, 2007, 11:30:10 PM11/27/07
to cocoa-sharp-dev
Hi Richard,

Thanks much for your reply. I have checked the source and for the
Control object(cocoa-sharp 0.9.4
it is exactly like you said it should be for the Cell, but still no
luck.
When I try to use assign the Value to another string, the
function(method) just stops.

Best Regards,
Zdravko
Reply all
Reply to author
Forward
0 new messages