RubyCocoa : AssignValueToPointerArgument

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:

   def actionOnObject_error(object, errorPtr)
     ...
     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#[]=.
© 2001-2007 The RubyCocoa Project. Powered by Wikka Wakka Wiki 1.1.6.3
SourceForge.net Logo
Page was generated in 0.0800 seconds