Method: Xcodeproj::Project::Object::AbstractObject#sort_recursively
- Defined in:
- lib/xcodeproj/project/object.rb
#sort_recursively(options = nil) ⇒ Object
Note:
Some objects may in turn refer back to objects higher in the object tree, which will lead to stack level deep errors. These objects should not try to perform a recursive sort, also because these objects would get sorted through other paths in the tree anyways.
At the time of writing the only known case is ‘PBXTargetDependency`.
Sorts the object and the objects that it references.
172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/xcodeproj/project/object.rb', line 172 def sort_recursively( = nil) to_one_attributes.each do |attrb| value = attrb.get_value(self) value.sort_recursively() if value end to_many_attributes.each do |attrb| list = attrb.get_value(self) list.each { |entry| entry.sort_recursively() } end sort() end |