The “How to start, build, launch and market your first iPhone App in 28 days” series so far:
Part 2: The Prep
Ok, so now that you’ve got all the paper work done (which you can do in a few hours) and you’ll be waiting for Apple to approve your Developer Program application, it’s time to start learning Objective-C and all things iPhone SDK. But first, what do you need to buy?
It might seem obvious to most people, but a common starter question is – do I need a Mac? Yes, in fact, you do. You cannot build an iPhone App on anything except an Intel-based Mac (or Hackintosh). This is essential and unavoidable. And technically, that’s all you are REQUIRED to have to build your first app.
Do you NEED an iPhone or an iPod touch? Well, I would definitely recommend it because you want to test it out on the device before you actually submit it, but technically, no, you don’t need to it build your app and submit it to Apple. The iPhone SDK comes with an iPhone simulator that you can build, run and test your apps on. There are a few limitations with it (no accelerometer, no camera, etc.) but if your first App doesn’t make use of these and you are strapped for cash, you can get away without buying one.
However, I still recommend picking up at least an iPod Touch so that you can actually test your App on a real device before you publish it. Clicking a mouse to simulate touch and tap commands won’t give you the real ‘feel’ of your app. It’s your first app so make a good impression. The last thing you want is bad reviews because you never actually tried your app on a real iPhone or iPod Touch.
Another question I hear is, how powerful of a Mac do I need to get? Really, ANY Intel-based Mac will do – even the Mac Mini. The entire line of Intel-based Macs are certainly powerful enough to build and run iPhone Apps on. Heck, when I started, I was coding on a Dell Mini 9 Hackintosh and that was MOSTLY adequate (I wouldn’t recommend the Dell Mini 9 Hackintosh though because of the low resolution and sometimes I’d get very frustrating keyboard lag when coding in XCode).
I’m coding right now on the lowest end, unibody Macbook and it’s more than enough power. I also have an external monitor that I hook it up to, but sometimes I code in bed so I have to live with the 1280×800 resolution which is fine because the iPhone simulator pretty much JUST fits vertically at that res. Only drawback is I cheaped out on the illuminated keyboard option and I regret it now because I can’t see my keys in the dark.
If you really are desperate to save a few bucks, check out the Refurbished Macs. Apple has a very high standard of quality and my refurb’d Macbook looked brand new when I got it and I’ve yet to have any issues with it.
Learning Objective-C and the iPhone SDK
So you’ve got your shiny new Mac (or your old one you’ve always had) and want to know, what’s the quickest and best way to learn? Fortunately, the best way is easily done through reading 2 books. The order in which you should read them depends solely on your programming experience.
Programming Newbies: Programming in Objective-C 2.0 by Stephen Kochan
If you have done little to no programming and don’t know C, C++, Java or any other programming language, then this book is for you. You should read this cover-to-cover and go through all the examples. As a new programmer, you’re going to have to put in extra effort and time to grasp core programming concepts before you can move onto the iPhone SDK. However, going through this book should get you a good start. After you’re done this book, you should be able to grasp the next book with ease.
Experienced Programmers New to Objective-C: Beginning iPhone Development by Dave Mark , Jeff LaMarche
This book is widely known as the Bible for starting with the iPhone SDK. It doesn’t assume familiarity with Objective-C, but it does assume experience with some C variant (C, C++, Java) and prior programming experience (OOP). If you’re an accomplished programmer in a similar language, you should go through THIS book first and just get Programming in Objective-C 2.0 as your reference book.
Beginning iPhone Development is a great starter book and will teach you almost all the basics of most of the iPhone OS 2.0 API’s. I write this just as the iPhone OS 3.0 SDK is being released which introduces 1000 new API’s and unfortunately, no book has covered those yet, but I’m sure someone will come out with something soon. In the meantime though, buy this book, read every page and every example and you’ll come out knowing almost everything you need to get you started.
One thing I should mention, but haven’t yet, is that I believe what’s very important in this learning process is that you should ALREADY have an idea of the app that you want to build. You should have in your head, what kind of app you are dreaming of and how it should look and function. This is important because it will motivate your learning by allowing you to visualize your app in the context of these lessons. You will seriously pay more attention to the chapters and lessons that apply directly to the app in your vision. I can’t stress how important this is because it will really motivate you to learn faster and make everything you learn actually stick.
CS193P – iPhone Application Programming
So, now that you’ve torn through the book (or both books if you’re a beginner), you should be ready to start building your app. But that doesn’t mean you’re finished learning! While the books provide a great starting point and may be enough to get you started on your app, I recommend that WHILE you’re building your first app, you should also watch the Stanford iPhone Programming lectures. They are available on iTunes for free and are excellent in providing a greater level of detail than the books. We found that they complement the basic knowledge that you will have of the iPhone SDK at this point and will just reinforce what you’ve already learned. I typically went through 1 or 2 lectures a day while developing iHeartRate and was constantly learning new things as well as building upon my existing knowledge. The lectures really brought it home for me.
Apps are for wussies – I want to build a game!
With both books and the Stanford lectures, you should have a great base upon which to build your App. However, if you’re planning on building a game, you’ve got a bit more learning ahead of you. UIKit, Core Animation and Quartz Core may be adequate enough for simple graphics and animation but if your game has lots of sprites and animation then you’ll need something more powerful.
OpenGL | ES
Fortunately, iPhone SDK supports OpenGL|ES which is a powerful 3D graphics API (OpenGL|ES is essentially a subset API of OpenGL). Unfortunately, because it’s so powerful, the learning curve is quite steep for OpenGL. Here are two well respected sources to begin your OpenGL training.
Neon Helium Productions offer a very extensive list of tutorials that will help you get started with OpenGL. While most of the tutorials are geared for OpenGL, they have started to port over their tutorials over to OpenGL|ES. At last count they have 48 tutorials which range from creating a simple polygon all the way to ArcBall Rotation (I don’t even know what that means). In any case, this is a GREAT place to get started.
This book earns its name as a true SUPER BIBLE. Widely recognized as THE book to get and the definitive reference book for OpenGL, this 1200 page monster is very dense and doesn’t mince words. It is NOT OpenGL for Dummies, so be forewarned. The tutorials are a nice start and this book is a good supplement to that and works well as a reference book.
Now if the thought of learning OpenGL|ES sounds daunting and you’re really only doing a simple 2D game, then you might want to take a look at the Cocos2D framework. It is an open source game development framework that has been used by many developers who’ve built successful 2D games with it. It has a good following and support and is very easy to pickup, compared to OpenGL|ES.
- Cocos2D Programming Guide – Great starting guide for learning the concepts of Cocos2D
- Cocos2D Google Group – Lots of support and great place to get answers and ask questions
- Cocos2D Best Practices for iPhone – Must know Best Practices when using Cocos2D for iPhone
- Monocle Studios Tutorials – Awesome tutorials on building Cocos2D projects
- Irrational Exuberance Guides – Good specific guides on using Cocos2D in your game
- BIT-101 Blog’s Cocos2d Tutorials – Great starter tutorials for Cocos2d
This is too much, how about I just build a web app?
1) Build your webapp
2) Launch your App as a Site Specific Browser (SSB)
So even if your app is just a web app, you can still release it on the App Store as an app that utilizes the built-in Safari browser but only access your web app. This allows your app to APPEAR like a native app but in fact, it’s just a browser that’s point to your iPhone specific web app. Pete Forde from Unspace gave a great talk about how they did exactly this with the iPhone App they build for The Score and numerous other projects and their users didn’t even know that the app was not built in Objective-C and was, in fact, just a web app wrapped in an SSB. You can find the presentation here: Pete Forde’s Mesh 09 – iPhone Application Development
Now hopefully, all that learning only took a week or so. And hopefully, while you spent all that time learning, you thought about your App and how you were going to use everything you were learning to build it and visualized how it would work. Depending on the complexity of your App, you may need additional resources to help you get through this first build. Here’s a short list of resources that we used as references while we built iHeartRate.
- Official Apple iPhone Dev Center – has a ton of guides, videos and reference material
- iPhone Dev SDK Forums – BEST iPhone Developer Forum on the web
- Official Apple Developer Forums – Apple’s Developer Forums (need to be enrolled in Dev Program)
- iCodeBlog – Awesome list of iPhone Programming Tutorials
- Mobile Orchard – Great articles, great examples and great blog overall
- The Apple Blog’s 43 iPhone Dev Resources – Great list of even more resources for iPhone Dev’s
With all these resources at your disposal, you’ve got no more excuses – start building! Now is the point when you’ve really got to just get down and start building your App. If you went through all the books and tutorials, building a basic prototype should be much easier now and you’ll learn even faster by just experimenting and playing with the SDK.
Next up in the series is The Design – where we talk about how important looks and usability is just as important as functionality.
Updated – Added a link to BIT-101′s great Cocos2d starter tutorial. BIT-101 Blog’s Cocos2d Tutorials