lib/cocoa/sugarcube-pointer/nsarray.rb in sugarcube-2.0.1 vs lib/cocoa/sugarcube-pointer/nsarray.rb in sugarcube-2.0.2

- old
+ new

@@ -8,6 +8,17 @@ ret[i] = self[i] end ret end + # @param type [Symbol] type A pointer type from the list at {http://www.rubymotion.com/developer-center/guides/runtime/ RubyMotion Pointers Reference#_pointers} + # @return [Pointer] An array of pointers of the specified type + def to_pointers(type) + self.map do |val| + ptr = Pointer.new(type) + ptr[0] = val + ptr + end + end + + end