Massive amounts of people are taking advantage of the App Store as an easily accessible marketplace. This has led to Objective-C’s increase in popularity, due to the fact that a majority of iOS apps are programmed with it. I consider Objective-C as Apple’s “thing” in the programming spectrum. If your target platform is developed by the Apple Corporation, like Mac OS X or iOS, I’d stick to Objective-C.
Benefits of Objective-C
- I hear your target market is iOS? Perfect. Objective-C truly has no competition when it comes to Apple products, since it’s targeted specifically for Apple’s creations.
- Objective-C is an object oriented programming language, as most modern programming languages are. In a nutshell, object oriented programming is an efficient way to divide your code.
- Apple recently added something to Objective-C called “Automatic Reference Counting” (ARC for short). ARC handles a lot of memory management for the programmer, which makes Objective-C more beginner friendly than before.
Disadvantages of Objective-C
- If I had to describe Objective-C in one word, I’d say “quirky.” When I first learned Objective-C, it threw me off at how different it was. Whenever I take extended breaks from it, I have to take the time to relearn the odd syntax.
- Using Objective-C for anything other than iOS or Mac OS X probably won’t happen. If you plan to branch out to operating systems other than those, you’ll have to spend some time learning another programming language.
- You need to own a Mac to do any serious iPhone or Mac programming. It’s about a $1000 investment, so it’s important to decide if it’s actually worth it to you. Joining the iPhone (or Mac) Developer Programs to submit your apps is also another $99.
XCode is my favorite IDE by far. XCode features beautiful auto-completion typing that helps you remember parts of your code or even Objective-C syntax itself. The project creation menu is well organized and straight forward. Best of all, this IDE has great debugging tools to help you squash bugs in your code.
Choosing a Graphics Library for iPhone Development
So you’ve decided that you want to develop with Objective-C for the iPhone. Good choice, because there are tons of options you can use for a graphics library.
If you’re like me, you’re only satisfied with building things from scratch. While this is the more time consuming route, you’ll definitely learn more. It’s a cool experience! I made my first iPhone game using OpenGL ES for iOS. When you choose OpenGL ES for graphics, you have to create all of the geometrical figures in the code and then apply textures to them to create graphics. Yep that’s right, you have to mathematically create every single shape in your game. Yikes.
If any of that scares you, don’t waste your time with OpenGL, it’s not worth it! I’m going to emphasize again on how much longer it takes to make a game this way. It took me about six months to make a simple game with OpenGL, and quite frankly, I’d probably never use it again. Definitely a one time thing for me.
Another choice that’s much more reasonable is one of my favorites, cocos2d. This graphics library/game engine makes it much easier to get images on the screen and it comes with a nice sound engine, too. Another nice feature of cocos2d is the physics engine, Box2D. Coding and testing all of the physics in a game is, just like I said earlier, a learning experience. But after doing it a few times, it gets old. In hindsight, I wish I would’ve used cocos2d instead of OpenGL to make my iPhone game. I would’ve saved myself a lot of trouble. Cocos2d is well maintained and has a nice community, so I recommend going to the cocos2d download page to get it.
Diving Into Objective-C
I don’t have any tutorials about Objective-C at this point in time, so you can check out Apple’s plethora of programming articles in the Mac Development Library and iOS Development Library. There’s also a quick tutorial on Objective-C if you feel like jumping right in to the language. Be sure to read up!