Oct 01

I’m starting to look into Cocos2D for the iPhone. Particularly, I’m looking into how to use it for simple 2D terrain manipulation and vehicle physics. So far, the API seems fairly clean and easy to use. It also seems quite robust with a number of features that I’ll need for my little project.

I quickly realized that I was falling into the same trap I did with jME. I was playing so much with getting low level basic features of an API in place (2D on OpenGL ES), that I lost sight of what I was wanting to do, and that’s write an app. Cocos2D seems to have cured that affliction.

Tagged with:
Sep 26

Noel Llopis has released his slides from AGDC. He discusses how to get every bit of performance out of this little “Pocket PC” (hey, Steve Jobs called it that, so can I). Noel is the creator of Flower Garden and a guru with OpenGL ES and pushing the iPhone to its limits. This is a great read, and one of the primary talks I wanted to attend, although timing of the conference didn’t allow me to see it.

Tagged with:
Aug 21

Wil Shipley has a great article on heuristics and human beings. Delicious Library is an amazingly well designed piece of software, and some of the lessons taught in this article should be taken to heart. Apple products have, honestly, raised the bar on what user’s expect when interacting with it. His point of sacrificing 100% accuracy for substantial more usability is a great one. This particularly applies to iPhone Apps, as the truly great ones are those that you immediately pick up and just inherently know how to use. The iPhone is a “quick use” device. Few people sit down and use their iPhone for more than just a couple minutes at a time. So, any moment you steal from them to force them to learn how to use your app (input data, etc) you have greatly reduced your target market.

Tagged with:
Jul 31

If you updated your iPhone to OS 3.0.1 (which you should), it will break your Xcode link to build to the device. To fix this you need to follow the instructions at:

http://adcdownload.apple.com/iphone/iphone_sdk_3.0__final/iphone_os_3.0.1_advisory.pdf

Tagged with:
Jul 28

I’m working on an application that requires switching from a List View in portrait mode into a Cover Flow View when the device is rotated into landscape mode. This means, a Controller needs to know when a rotation has occurred and present the correct view. This was my first opportunity to play with Notifications.

  1. The Device generates these notifications on request. So, the first thing we need to do is tell it to start generating them.
  2. The Controller has to register to listen for these events.
  3. A Selector is provided as a callback when an event occurs.

Here is the code snippet that manages this:

- (void)viewDidLoad {
    [super viewDidLoad];

    [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];    
    [[NSNotificationCenter defaultCenter] addObserver:self
           selector:@selector(deviceDidRotate:)
           name:@"UIDeviceOrientationDidChangeNotification"
           object:nil];    
}

- (void)deviceDidRotate:(NSNotification *)notification {
    UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];

    if (orientation == UIDeviceOrientationLandscapeLeft ||
                      orientation == UIDeviceOrientationLandscapeRight)
    {
        NSLog(@"Sideways");
    } else {
        NSLog(@"Portrait");
    }
}
Tagged with:
Jul 07

A friend pointed me to the Stanford iPhone Classes offered on iTunes as part of iTunes U. There are a number of free videos (23 to be exact) taught by Apple Engineers (Evan Doll, Alan Cannistraro and others). I’ve gone through the first two lectures. Admittedly, they require substantial fast forwarding in sections due to length discussion about office hours and the like, the core material is outstanding.

Find it here: http://deimos3.apple.com/WebObjects/Core.woa/Browse/itunes.stanford.edu.2024353965

Tagged with:
Jul 04

There are a few steps that one must go through in order to setup their machine for iPhone development. First, you need to install XCode (and related tools), next sign-up for an Apple Developer Connection account, and last download and install the iPhone SDK.

Installing XCode

This is fairly straight forward. If you’ve recently purchased a new Mac, you’ll have a DVD with called the Tools Disk. Simply put this in the drive and run the installer. This will install XCode and many other developer tools. I’ll go over the tools in later posts as I learn about them. But some highlights are:

  • XCode – the primary IDE for Mac development. This is where we’ll be spending much of our time editing source code.
  • Instruments – a tool for gathering profiling information about your running application.
  • Interface Builder – this little guy is the graphical UI tool for setting up your interface and connecting it to source code.

If you don’t have the proper DVD, you can download the Tools DMG from the Apple Developer Connection Site.

One interesting note, is all Applications for development go into /Developer/Applications, not /Applications/Developer as I would have expected. I must admit this caused me a bit of confusion for awhile.

More information can be found at: http://developer.apple.com/documentation/Xcode/Conceptual/XcodeCoexistence/Contents/Resources/en.lproj/Basics/Basics.html

Sign Up for Apple Developer Connection

You can sign up for a free ADC account. This will give you access to a number of SDKs, including the iPhone SDK. It also gives access to a substantial amount of documentation (including the beginning iPhone development doc referenced below). Go to developer.apple.com and sign up. Later, we’ll need to sign up for the iPhone Developer Program (which is not free) in order to actually get our application to the iPhone device (rather than just the simulator), but that’s for later when we have something worth showing off.

Download and Install the iPhone SDK

Once you have your ADC account, sign in and go to http://developer.apple.com/iphone/program/sdk/. Here you can get the SDK (over 2 GB of SDK goodness). Once the download is complete, install it, and we are ready to begin.

Additional Info

I’ve decided to go through iPhone Development Guide for my first “Hello World” app. You can find it here: http://developer.apple.com/iphone/library/documentation/Xcode/Conceptual/iphone_development/000-Introduction/introduction.html

Tagged with:
Jul 03

One of the key elements for iPhone development is a machine running OS X. There are currently no development tools to allow iPhone development on any other operating system. I’ve been a fan of Apple’s computers for a couple years now and already had a MacBook Pro. Fortunately, this allowed me to get started relatively quickly and easily.

Where to buy? I recommend moving next to an Apple employee and getting a 25% discount. That’s what I did and it worked out well. However, that’s not terribly practical for most people. I have bought refurbished Macs before and have been very happy. You can easily save a couple hundred dollars.

FirefoxScreenSnapz005

The above is from the Refurbished Store as of the writing, and shows that they have the “latest and greatest” available. Apple provides fantastic support for refurbished machines, treating them as new. I highly recommend going this route.

Once, I had my machine, I found out that OS X loves memory. Its memory model will allow it to take advantage of all the memory you can physically put into the machine. I upgraded my Mac’s RAM to 4GB (purchased from newegg.com as Apple’s memory prices are absurd). After putting the new modules in, I noticed a marked speed improvement. Applications are much faster to load, switching between is very fast. My machine is now a year old, and I still feel like it’s a better machine than most brand new computers I come across.

FirefoxScreenSnapz004

Many people have reported being very happy buying a basic Mac Mini for iPhone development. This is certainly a cost effective way doing so, especially if you don’t plan on using a Mac for your basic computing needs.

Once you have the machine you want, update to the latest OS X version and install the Apple Developer Tools.

Tagged with:
Jul 02

Garage development is back. The days of two guys staying up late, hacking away at code with dreams of fortune and fame are back. No longer do you require a $50 million budget to make a AAA title that will scarcely make enough money to pay back the development costs. Enter the iPhone, our savior of development. Now, anybody can throw their hat in the ring and barely make enough money to pay back development costs. But, this time development costs are very low!

This blog will chronicle my journey down the development of simple iPhone applications. As I learn, I will log it here. Including setting up and educating myself on the tools, Obj-C, Cocoa Touch and anything else I find along the way.

Tagged with:
preload preload preload