How to Transition an Existing App to Core Data

The initial structure of my app ChronoCat was super simple: Just one custom class, all objects from that class are thrown into an array, that array is displayed by a table view and is written/read from disk as needed. Here is the basic process I used to migrate the app away from objects-in-an-array to Core Data:

  1. Make a Core Data entity to represent my custom class.
  2. Added all the @propertys from my custom class as attributes to the new entity. (@propertys only at this point, methods come later) .
  3. Make the NSManagedObject Subclass of my new Core Data model.
  4. Make a category for my NSManagedObject Subclass to store any methods I had in my custom class.

Now that the swap from a custom object to Core Data was complete the last step was to create a class to import the user’s existing data into the new Core Data model. Here is what I did for that:

  1. Made a new group in Xcode and added the old custom class used in the initial version of ChronoCat to it. The new version of my app is a complete rewrite so the old class file was not already in the project.
  2. In that same group I added a new class to put all my import code in.
  3. The import process is to check for the old data file in the app’s document folder, if found load the data from binary back into an NSArray, then use a for loop to cycle through the objects in the array and save them as a new NSManagedObjects.
  4. Once that’s done clean up by deleting the old data file.

The whole process was shockingly painless and has been a great way to get my feet wet with Core Data. The new version of ChronoCat that utilizes Core Data is currently in review and will hopefully be approved and available soon.

How to Add Device Frames to Your App Screenshots

I had always assumed the little iDevice frames you put your app screenshots in was done using Photoshop. I ended up happily being wrong on this one, there is a much easier way than Photoshop to do it. Instead of having to track down some Photoshop template and in my case, learn Photoshop, I was able to find a webpage to do it for me. 

The site is iphone-screenshot.com and all you have to do is pick your device, upload your screenshot, and it spits back out neatly framed in the device of your choosing. It’s what I ended up using for the new ChronoCat landing page, here are a couple of examples:

ChronoCat 2.0 Coming Soon

I am very excited to be finally submitting my 2.0 update for ChronoCat to Apple today!

This update includes a brand new interface and icon along with the ability to remove ads via an in-app purchase. A majority of the changes in this update are actually all under the hood changes that I will dive into more in a follow-up post. 

In the meantime, while I am waiting for Apple to approve the update, feel free to take a look at the new ChronoCat homepage to see how its going to look.