I’ve mentioned a number of excellent tools and libraries for working with Core Data, most recently the excellent PonyDebugger editor.
Here’s a new library from Marty Dill called iOS-Queryable that aims to simplify the creation of complex Core Data queries.
The library allows you to eliminate most of the boiler plate code when created complex core data queries by bringing a subset of methods from the IQueryable and IEnumerable libraries from Microsoft.NET LINQ framework.
This is best shown with an example and the example given on the readme is that with this library you can write code like this:
where:@"Type == 'abc'"]
NSEntityDescription* entity = [NSEntityDescription
NSPredicate* predicate = [NSPredicate predicateWithFormat: @"type == 'abc'"];
NSSortDescriptor* sortDescriptor = [[NSSortDescriptor alloc]
NSArray* sortDescriptors = [[NSArray alloc] initWithObjects: sortDescriptor, nil];
NSArray* widgets = [self.managedObjectContext executeFetchRequest:fetchRequest error:&error];
You can find iOS-Queryable on Github here.
There’s much more to the library than what’s been shown here, and you’ll definitely want to check it out if you find yourself writing some complex core data queries.
Submit A Resource
Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?
You can submit the url here.
The resources we feel will appeal to our readers the most will be posted on the front page.