class Xcodeproj::Project::Object::AbstractGroupEntry

def <=>(other)

Sorts groups before files and inside those sorts by name.
def <=>(other)
  if self.is_a?(PBXGroup) && other.is_a?(PBXFileReference)
    -1
  elsif self.is_a?(PBXFileReference) && other.is_a?(PBXGroup)
    1
  else
    self.name <=> other.name
  end
end

def destroy

def destroy
  group.child_references.delete(uuid)
  super
end

def initialize(project, uuid, attributes)

def initialize(project, uuid, attributes)
  is_new = uuid.nil?
  super
  # If there's no root_object yet, then this is probably the main group.
  if is_new && @project.root_object
    @project.main_group.children << self
  end
end