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-4.0.0 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.5.0 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.4.2 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.4.1 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.4.0 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.3.7 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.3.6 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.3.5 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.3.4 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.3.3 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.3.2 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.3.1 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.3.0 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.2.0 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.1.1 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.1.0 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.0.8 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.0.7 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.0.6 lib/cocoa/sugarcube-pointer/nsarray.rb
sugarcube-3.0.5 lib/cocoa/sugarcube-pointer/nsarray.rb