When you override in Ruby an Objective-C method which is supposed to return by reference some arguments, like the traditional NSError ** pattern, you can use the ObjcPtr#assign method:
If you want to assign a value to a particular offset, you can use ObjcPtr#[]=.
def actionOnObject_error(object, errorPtr)
...
if problem
error = NSError.alloc.init...
errorPtr.assign(error)
return false
end
...
end
...
if problem
error = NSError.alloc.init...
errorPtr.assign(error)
return false
end
...
end
If you want to assign a value to a particular offset, you can use ObjcPtr#[]=.