The colorful wolf

October 27, 2009

The iPhone

Filed under: Tech — randy @ 19:03

I’ve been developing for the iPhone for over a week now, and I’m starting to get used to it. In the process of getting used to it I made a lot of mistakes though, so I thought I’d share some of the stupid things I’ve done.

* C: Using the equals ‘=’ character in DEFINE (did this twice too…)
* Xcode: Importing the .h file but not linking the library (took a lot of time to figure this out for the first time, and to find out where in Xcode to add it)
* Confusing and mixing C, C++ and Objective-C syntax
* Ignoring memory management just to ‘get it to work’
* One word: NSAutoReleasePool.
* Mac: assuming that Mac cannot do something quickly just cause I don’t know the right key combination
* Mac/Xcode: the Interface Builder is a lie!
* AudioQueue framework: the mere act of choosing to use this framework is a mistake. Too bad it couldn’t be avoided.
* PCM formats: why in the name of Sean Connery are there so many variations on plain and simple uncompressed pcm data?

The last one seriously cost me a lot of time, because I couldn’t get my pcm data to become little endian. It’s supposed to be a simple flag that you can turn on and off when setting up the audio queue, but the queue simply fails to initialize if you don’t specify big endian. I suspect this may have something to do with the nativeness of the audio chip (apparently Motorola defaults to big endian even though everything else in the iPhone is little-endian), but I have little resources or motivation to prove this. In the end I chose to flip the audio streams bytes myself, which made everybody happy in the least amount of time required.

Last note on the iPhone: I am by no means biased towards Apple. If anything I have a negative bias to them for making average hardware and selling it for top prices just because it’s cool, when a rival product is usually available for less money and has more capabilities. I particularly despise the way Apple forced me to use synchronization in iTunes just to get nested playlists to work on my iPod, and I still have not forgiven them for that. Now that my mini-rant is over, I just would like to say that the iPhone is indeed damn bloody cool and if I had one I’m sure I would love it to death.

I’m not buying one though.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: