Sha256: f3b7d5cf0c9e37e99fe1643b822d5cc8d7b42f813d695aa5b27b6e50aae04111
Contents?: true
Size: 789 Bytes
Versions: 23
Compression:
Stored size: 789 Bytes
Contents
class NSArray # Creates an NSIndexPath object using the items in `self` as the indices # @return [NSIndexPath] def nsindexpath if self.length == 0 raise "An index path must have at least one index" end path = nil self.each do |val| if path path = path.indexPathByAddingIndex(val) else path = NSIndexPath.indexPathWithIndex(val) end end return path end # Creates an NSIndexSet object using the items in `self` as the indices # @return [NSIndexSet] def nsindexset if self.length == 0 raise "An index set must have at least one index" end set = NSMutableIndexSet.indexSet self.each do |val| set.addIndex val end set end def nsset NSSet.setWithArray self end end
Version data entries
23 entries across 23 versions & 1 rubygems