Monday, September 19, 2011

Let the Coding Begin!

Well, another week has gone by and it's time for another post.  This past week has been a lot of fun!!  I've been able to scrape together quite a bit of time to dedicate to things iOS and iPhone and things are going really well.  I'm putting the finishing touches on ScoreApp, my first iPhone application.  I'm going to be submitting it to the App Store hopefully by the end of the week or early next week.  I'm treating this app as a learning experience and am getting a lot of the infrastructure that an app needs together for this app, even though I really don't think it will be the next Angry Birds.  The more time I spend with Xcode 4, iOS and Objective C, the more I like it.  Here are a few of the things that I've learned in the past few weeks:

Memory management was the number one thing that I didn't like when coming from a clean, garbage collected world.  I didn't like that I, as a programmer, had to be concerned with things that I thought compilers should be able to do reliably.  But, as I have looked through sample code, played with Xcode and watched some iTunes U classes, memory management has started to become second nature.  I don't notice that I'm doing it anymore.  If I alloc something, I've got to figure out where I'm going to release it.  That's about all there is to it.  I mean, there are some nuances that are more complicated than that, but it's not bad at all.  Xcode has an "Analyze" option and a "Profile" option in the project menu that give you some great tools that will help you detect and eliminate potential leaks.  While it is still not ideal, it is a lot less painful than I expected initially.  As iOS 5 comes down the pipe-line, there is a feature called ARC or automatic reference counting that will be available.  I understand this to be like compile time garbage collection.  You can turn on ARC and your compiler will detect and insert appropriate retain/release statements to make sure your program doesn't leak memory.  This feature could be nice, but I've not used it yet, so only time will tell I guess.

Core Data is another feature that I wasn't quite sure of when I began my foray into iOS world.  It turns out that Core Data is possibly one of the coolest and most powerful solutions for data that is absolutely awesome for the iOS environment.  Core Data is a framework that encapsulates and SQLite database using a base class called NSManagedObject.  You can subclass this base class to have custom objects that have any unique or calculated properties that you might want.  You get started with Core Data most often by creating a mapping of your database.  You create your entities, which attributes they have and what kind of relations they have.  Then you can generate some NSManagedObject subclass stubs for you entities and flesh them out to your hearts content.  Then, as you code your app, you use some very simple and intuitive objects (NSManagedContext) to fetch and put entities into the persistent storage.  Admittedly, I'm not building large scientific databases with my applications yet, but so far the performance and ease of use of Core Data is awesome!!  It's the slickest database tool for oo programmers that I've ever used.  It similar to hibernate, llblgen, other ORM tools, but it's done the Apple way.  Consistent and friendly messages are used to use the framework.  I've really begun to like it.

The app itself has been a joy to create.  Right now I've got my app on a handful of beta-tester's iPhones and it has been getting pretty solid reviews so far!  I'm excited to take the next steps, get a website set up (, start tweeting for publicity (@ScoreAppIT) and try to give this app a chance to at least get a few downloads when it launches.  

Look for my next posts to be about the process of preparing the app for submission, and hopefully I'll have some news about how the launch day went.  Until then, reach for the clouds!

1 comment:

  1. The encoding of the application facilitates the transfer of the necessary objects to a special repository. This is important in the workflow.


Please leave a comment. Thanks!