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-2.4.2 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.4.1 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.4.0 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.3.0 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.2.0 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.1.5 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.1.4 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.1.3 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.1.2 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.1.1 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.1.0 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-2.0.2 lib/cocoa/sugarcube-pointer/nsarray.rb