int count = rowCount(); int start = (currentBatchIndex()-1) * numberOfObjectsPerBatch(); int end = start + numberOfObjectsPerBatch();  if (numberOfObjectsPerBatch() == 0) { start = 0; end = rowCount(); } EOFetchSpecification spec = databaseDataSource().fetchSpecificationForFetch();  spec.setSortOrderings(sortOrderings());  EOEditingContext ec = databaseDataSource().editingContext(); _displayedObjects = ERXEOControlUtilities.objectsInRange(ec, spec, start, end).mutableClone();
refetch();
    public NSArray displayedObjects() {        if (!isBatching()) {            return super.displayedObjects();        } else {            if(_displayedObjects == null) {                //check the start and end based on currentBatchIndex and numberOfObjectsPerBatch()                int count = rowCount();                int start = (currentBatchIndex()-1) * numberOfObjectsPerBatch();                int end = start + numberOfObjectsPerBatch();                if (numberOfObjectsPerBatch() == 0) {                    start = 0;                    end = rowCount();                }                EOFetchSpecification spec = databaseDataSource().fetchSpecificationForFetch();                //sortOrderings from the WODisplayGroup is only used in Memory: painful slow...                spec.setSortOrderings(sortOrderings());                EOEditingContext ec = databaseDataSource().editingContext();                _displayedObjects = ERXEOControlUtilities.objectsInRange(ec, spec, start, end).mutableClone();            }        }        return _displayedObjects;    }