def initialize_from_file
      pbxproj_path = path + 'project.pbxproj'
      plist = Plist.read_from_path(pbxproj_path.to_s)
      root_object.remove_referrer(self) if root_object
      @root_object     = new_from_plist(plist['rootObject'], plist['objects'], self)
      @archive_version = plist['archiveVersion']
      @object_version  = plist['objectVersion']
      @classes         = plist['classes'] || {}
      @dirty           = false

      unless root_object
        raise "[Xcodeproj] Unable to find a root object in #{pbxproj_path}."
      end

      if archive_version.to_i > Constants::LAST_KNOWN_ARCHIVE_VERSION
        raise '[Xcodeproj] Unknown archive version.'
      end

      if object_version.to_i > Constants::LAST_KNOWN_OBJECT_VERSION
        raise '[Xcodeproj] Unknown object version.'
      end

      # Projects can have product_ref_groups that are not listed in the main_groups["Products"]
      root_object.product_ref_group ||= root_object.main_group['Products'] || root_object.main_group.new_group('Products')
    end
def initialize_from_file
      pbxproj_path = path + 'project.pbxproj'
      plist = Plist.read_from_path(pbxproj_path.to_s)
      root_object.remove_referrer(self) if root_object
      @root_object     = new_from_plist(plist['rootObject'], plist['objects'], self)
      @archive_version = plist['archiveVersion']
      @object_version  = plist['objectVersion']
      @classes         = plist['classes'] || {}
      @dirty           = false

      unless root_object
        raise "[Xcodeproj] Unable to find a root object in #{pbxproj_path}."
      end

      if archive_version.to_i > Constants::LAST_KNOWN_ARCHIVE_VERSION
        raise '[Xcodeproj] Unknown archive version.'
      end

      if object_version.to_i > Constants::LAST_KNOWN_OBJECT_VERSION
        raise '[Xcodeproj] Unknown object version.'
      end

      # Projects can have product_ref_groups that are not listed in the main_groups["Products"]
      root_object.product_ref_group ||= root_object.main_group['Products'] || root_object.main_group.new_group('Products')
    end
Initializes the instance with the project stored in the `path` attribute.