What I learned while developing for the iPhone

Categories: Adobe Flex AS2 AS3 iPhone Objective-C XCode

Now that MASH, my first game for the iPhone and iPod touch, has been in the App Store awhile (more info here: http://magnatemobile.com/apps/mash), I thought I’d take a moment to jot down some of my thoughts on the experience and what I learned, not having done Cocoa or Mac development previously.

I came to Objective-C having had the bulk of my programming experience using scripting languages like ActionScript (AS2 and AS3), JavaScript, and PHP, as well as a fair amount of C# and Java. The transition to C style syntax and methodologies wasn’t a giant leap, but there was definitely a learning curve involved. These are some of the things I learned.

Coming from Eclipse-based IDEs, I was used to having the file and folder structure of my project in the editor match up to the structure I’d see in Finder (or Explorer if I was on Windows) - in XCode, though, you can arrange and re-arrange the files and groups within the editor without actually changing the location of the corresponding item in the filesystem. I’m still not sure if I like this - there are times when I want to re-arrange files (especially the location of graphics) in my project using Finder’s column view instead of XCode’s list view.

Know when to retain and when to release. Releasing an object that you needed to keep will cause your program to crash. Seems like a no-brainer, but not understanding why my app crashed when I would invoke a “Start Over” method I created had caused me to spin my wheels for about a half hour. Additionally, take care not to “over-release” an object - the console will spit out malloc warnings that aren’t self-evident as to their cause.

When it comes to creating an app from the get-go with multiple languages in mind, creating a Strings file first and then using NSLocalizedStringFromTable is one way to do localized strings, but isn’t necessarily the conventional way. After having implemented localized strings that way first, I later learned that XCode has a process for writing your code first with the strings you intend to use, and then allowing the compiler to handle creation of the necessary files.

XCode does a very nice job with HeaderDoc documentation. It’s much easier to use than Flex Builder and ASDoc, in my experience. HeaderDoc doesn’t try to document every class in your project like ASDoc does by default, just those you tell it to.

You may have heard horror stories about long waiting times and applications rejected for seemingly trivial or vague reasons - while that hasn’t been my experience, I will say that the process for submitting an application is less than ideal. It takes a lot of time, forms ask for information in a strange order (this isn’t exactly the process, but on some form pages it’s a little like: enter the information about your app, then choose graphics to upload; after clicking to upload the graphics and the page refreshes, the previously entered form information is wiped out and you have to enter it again - frustrating!). Submission to approval time for my app and updates have been fairly quick so far, less than a week from “In Review” to “Ready for Sale”, so I don’t think I can complain about long waits, although the anticipation of not knowing if your app will be approved or rejected is bad enough.

Overall, I’ve enjoyed the process of learning to develop for the iPhone. I’d imagine the learning curve is probably steepest for those without previous object-oriented development experience, but for anyone with a good idea and a willingness to learn (and shell out for tooling and a developer certificate), I’d say the effort has been worth it.

FI Launches Kontain Alpha

Categories: ActionScript Adobe Flex AS3 Cool Sites Flash RIA


Kontain, the Flash-based blogging and media sharing site from agency powerhouse FI launched its alpha version on November 13th. The evolution of FI’s Propod rich media blogging system, Kontain is a promising and beautifully designed site. The clean design is mildly reminscent of Virb, with a pinch of (new) Facebook thrown in for good measure.

FI is one of few firms that can do full Flash sites very well. However, understanding that it is still an alpha, the site really ought to provide alternate content for computers without Flash installed. And while the site does attempt to redirect to a slimmed down version of the site for iPhone/mobile users, on my iPhone sending to http://i.kontain.com/ failed because of “too many redirects”.

It remains to be seen if the lack of alternate content for search engines will be detrimental (although FI may have plans to provide alternate content in a future release), or if Google’s advancements towards Flash content discover-ability will overcome this sticking point.


As a funny side note, the back-end for Kontain appears to be running JBoss/Apache on a ColecoVision (operating at 3.58 MHz).

Even Richer Internet Apps with Adobe AIR 1.5

Categories: ActionScript Adobe AIR Adobe Flex AS3 Flash WebKit

Adobe AIR logo

Adobe has just released Adobe AIR 1.5. Now you can take advantage of great features like Pixel Bender for custom filters and fills, the new 3D effects, dynamic video streaming (based on available bandwidth), and the Speex audio codec, aimed at providing high-quality audio delivery at lower bandwidth.

In addition to the existing Encrypted Local Store functionality in earlier versions of AIR, Adobe has now added encrypted local databases, which will make it easier to encrypt and locally persist large data sets.

Also, as a follow up to an earlier post on the use of SquirrelFish in AIR, Adobe has confirmed that this is indeed the case. Adobe AIR 1.5 has a WebKit update that incorporates SquirrelFish - Adobe claims that HTML-based AIR applications can run as much as 35% faster.

Download version 1.5 of Adobe AIR.

Developer and User release notes are available as PDF.

On a related note regarding the Flex Builder 3.0.2 update that takes advantage of the new AIR runtime: be sure to change the app.xml XML namespace to use 1.5 instead of 1.0, as noted on this blog - http://www.bobsgear.com/display/ts/Can%27t+Launch+Air+Apps+After+Upgrading+from+Flex+Builder+3.01+to+Flex+Builder+3.02  I had trouble with my application until I found this post.

Adobe and Zend announce collaboration

Categories: Adobe Flex AS3 PHP


via The Official Flex Team Blog

Adobe and Zend have announced their collaboration in bringing together the benefits of open source Flex with the reliability and flexibility of the enterprise-grade PHP Zend Platform (official press release). A recent article on Adobe Developer Connection details how to get up and running with Zend Studio and the Eclipse plugin version of Flex Builder 3.


gTween - New AS3 Tweening Engine

Categories: ActionScript AS3 Flash

Grant Skinner and his team have created a new tweening engine for AS3 that, in his words, better fit the needs of his team. And may fit yours better, too - it’s at least worth checking out.


Aspects that look interesting to me: the Proxy tweening feature, the timeInterval and timingMode (frame, time, or hybrid) properties, sequencing tweens and synchronizing tweens. All in only 4.5 K.

Once I get a chance to do some experiments with gTween, I’ll update this post.

Plinko Game in AS3 using APE Flash physics engine

Categories: ActionScript AS3 Cool Sites

Via DrawLogic

Plinko game screen

Until you’re the next contestant on The Price is Right, you can play a Flash version of the brilliantly simple yet fun game Plinko. Plinko uses ActionScript 3 and the 2D ActionScript Physics Engine (APE).

Play the game: http://client.drawcode.com/em-plinko/
Learn more about APE: http://www.cove.org/ape/

Flex in a Week video training

Categories: ActionScript Adobe AIR Adobe Flex AS3 Howto

Adobe is offering Flex training on their developer site using videos and supplemental PDFs. Check it out here: http://www.adobe.com/devnet/flex/videotraining/

As of this writing, days one through three have been added.

Invitations to Aviary

Categories: Adobe Flex AS3 Cool Sites

I currently have five four invitations to Aviary (http://a.viary.com/) if anyone is interested.