I try to return an errorpointer as shown in http://rubycocoa.sourceforge.net/AssignValueToPointerArgument.
this is my test code.:
class Contr < OSX::NSObject
error = NSError.alloc.initWithDomain_code_userInfo(
end # generate_error
errorPtr = ObjcPtr.new(1)
a = NSAlert.alertWithError(errorPtr)
end # trigger
end # Contr
Anyway, I get a runtime error when using "errorPtr.assign(error)":
2010-02-13 19:59:49.816 ErrorTest Contr#trigger: TypeError: can't convert OSX::NSError into Integer
Looks like i have to somehow tell the instance, what object I want to assign, perhaps when generating it.
But I did not find any documentation about ObjcPtr.new. It requires one parameter. I tried do find an indication in the objective-C code of this class, but I was not successful.
Please give me a hint.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.