Sha256: b872ae6ac376a37fbe4ee21bde09904d3b0c3aac62b80cde4d66b8ab3d9c1d38

Contents?: true

Size: 736 Bytes

Versions: 52

Compression:

Stored size: 736 Bytes

Contents

class NSArray

  # @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] A pointer to the array, of the specified type
  def to_pointer(type)
    ret = Pointer.new(type, self.length)
    self.each_index do |i|
      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

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
sugarcube-3.0.4 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.0.3 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.0.2 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.0.1 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.0.0 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.12.3 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.12.2 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.12.1 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.12.0 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.11.1 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.11.0 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.10.0 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.9.1 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.8.2 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.8.1 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.8.0 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.7.1 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.7.0 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.6.0 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.5.0 lib/cocoa/sugarcube-pointer/nsarray.rb