Tag Archives: helper

Core Data Helper – the final chapter!

I’ve probably written about the Core Data Helper too many times for one blog, but I thought just to finish it off I’d write one more article with a good solid downloadable project to demonstrate the use of Core Data Helper.  Basically the helper wraps core data stuff to make accessing it a little tidier… in fact, instead of re-inventing the written wheel (?), why not read about it in the other article HERE and then come back.

So what’s this article all about then?  Well, just below this paragraph is a download link to my project which very basically shows how to use the Core Data Helper.  It also has a useful XML parser for pulling in some default data from an XML file to your Core Data store.  I use this similar format for data which will appear in static lookups and suchlike.  Go download it and take a look…. Continue reading

Core Data helper – REVISED

After my initial post regarding the the modified Core Data helper (by Björn Sållarp in this article) I decided to alter it to be a bit more helpful, so I added a few more methods to perform some commonly required tasks. You’ll find the revised class at the bottom of this article. Here are the new methods and examples of how you would use them. For completeness I’ve included the original methods too. The error checking for all the methods has been changed and should be working correctly (they don’t do anything – but you’ll be notified if something didn’t work and can write your own handling). So… after including the class in your file you can do the following… Continue reading

Core Data query helper

THIS ARTICLE HAS BEEN REVISED. YOU CAN FIND THE NEWER VERSION HERE!

I’ve recently started using Core Data quite a bit for a few different projects and quickly found this bit of code and modified it slightly for my own use. It was originally posted by Björn Sållarp through his blog, on a helpful post about how to use Core Data and I’ve continued to use it since in different formats.

The code basically returns a data set from Core Data (with or without a predicate) without having all the messy code for each query. Here’s the code… Continue reading