My first iPhone app!
Well, I’ve done it; I’ve written an application for the iPhone to be distributed in the Apple App Store!
The app is mostly a pet project designed to compliment my weather website (http://wx.kd5hia.net), which is why I’m making it available free of charge. It’s been a tough road learning a new programming language. It’s been a long time since I stared at a blank IDE screen, wondering “where do I start”?
Back in 2002 when I wanted to learn PHP and MySQL, I bought a book that was supposed to guide me through creating a jokes database — a web application that you could use to add, edit, and delete jokes in a database. However, I never finished the book. Once I got far enough into the book where I saw how to use PHP to connect to and query a MySQL database, I put it down and began poking around on my own. I’ve never had patience for books when the light comes on. Now, looking back, I’ve written millions of lines of PHP.
I learned ColdFusion in a similar manner, but that was easy to catch on to with it’s HTML-like syntax and Macromedia’s (now Adobe) extremely detailed online reference.
But that was easily six years ago. Yeah, I know, not a really long time. But still, Objective-C is a huge undertaking, and I was worried that I wouldn’t be able to catch on before I got too frustrated. I have a habit of giving up on things when I feel like the amount of effort I’ve put into it far outweighs the progress I’ve made.
Objective-C is an object-oriented language, and I’ve always had trouble with fully grasping the concept of [tip:OOP=Object-Oriented Programming]. When I started learning PHP, it was procedural with some OOP concepts if anyone wanted to write it that way. Nowadays, PHP is really leaning hard toward OOP and I’m catching on okay, I guess. I’ve read all over the Internet that Objective-C is based in C and either 1) learn C first, or 2) if you already know C, Objective-C should be easy. Yeah, right. Talk about a square pill.
But I had to start somewhere, so I bought a copy of the book, Programming in Objectve-C, by Stephen G. Kochan (get it on Amazon). There are LOTS of positive reviews about this book, with many mentions from now-proficient Objective-C coders, so I figured this was my best shot. Once I cracked the book open, I was immediately overwhelmed.
Concepts such as instance versus class methods, delegates, subclassing, and view controllers seemed just too much for me to handle. How am I supposed to identify what I need to know right now? Objective-C is not like PHP where you can just open a text editor, write some code, and test it in a web browser (because when it blows up, it’s pretty damn easy to find out where and why). With Objective-C, there are a ton of things you have to write and get right before you can even compile and execute.
With learning new things, I do pretty well with books, but trial-and-error is where I get the most out of learning. So I decided to poke around the Internet to see if there were any tutorials on creating one’s first application, with source code that I could tinker with. More specifically, I needed to find something that would show me how to download and parse XML, which is the language I’m using to output data from my weather servers.
It took a nearly a solid month of hacking and cussing nearly every evening and weekend to finally start to catch on, after nearly two months I have a working application that’s actually useful (to San Angelo residents, anyway).
I have a rather “icky” feeling about the code I wrote. I mean, it works — it compiles perfectly without any warnings, but I feel like it’s messy. But, I have to start somewhere, and I’ll eventually learn enough about Objective-C that I can go back and laugh at myself while I optimize my code…


24 October 2010 
Author Info






No comments yet... Be the first to leave a reply!