Getting the Item Count

Getting the Item Count

The get count operation returns the number of the result items instead of the items themselves. This can save you bandwidth and client processing.

Count of filtered items

In order to get just the count rather than the whole array of items you need to call the countForFetchRequest method of EVDataStore instead of calling the executeFetchRequest method.

EVFetchRequest *request = [EVFetchRequest fetchRequestWithKindOfClass:[Activities class]];
[request setPredicate:[NSPredicate predicateWithFormat:@"ModifiedAt > %@",date]];
[dataStore countForFetchRequest:request block:^(NSUInteger count, NSError *error) {
    //the result will be stored in the count block parameter.    
}];
Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.