lib/sugarcube/array.rb in sugarcube-0.7.2 vs lib/sugarcube/array.rb in sugarcube-0.7.3
- old
+ new
@@ -6,6 +6,22 @@
ret[i] = self[i]
end
ret
end
+ def uiindexpath
+ 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
+
end