Friday, June 12, 2009

Lessons from the HelloWorld application

Creating the HelloWorld application opened my eyes to several things. Firstly, Objective-C and Cocoa are unlike any other programming language I've ever learned. The syntax is not very straight-forward. That means I'll probably have to spend a few weeks at the very least to learn the basics of Objective-C and Cocoa programming. Secondly, the concept of memory management for the iPhone is something that requires a lot of attention (i.e - is a bitch for the programmer).

"In general, however, you should try to avoid using autorelease wherever possible as it’s a more resource intensive operation than release."

Apple recommends that iPhone programmers follow these memory management guidelines:

To make sure it is clear when you own an object and when you do not, and what responsibilities you have as an owner, Cocoa sets the following policy:

  • You own any object you create.

    You “create” an object using a method whose name begins with “alloc” or “new” or contains “copy” (for example, alloc, newObject, or mutableCopy).

  • If you own an object, you are responsible for relinquishing ownership when you have finished with it.

    You relinquish ownership of an object by sending it a release message or an autorelease message (autorelease is discussed in more detail in “Delayed Release”). In Cocoa terminology, relinquishing ownership of an object is typically referred to as “releasing” an object.

  • If you do not own an object, you must not release it.

This policy applies both to GUI-based Cocoa applications and to command-line Foundation tools.

The entire documentation can be found here:

http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/MemoryMgmt/MemoryMgmt.html#//apple_ref/doc/uid/10000011

HelloWorld! My first iPhone Application

Yesterday, I finally got Mac OSX 10.5 (Leopard) and the iPhone SDK installed on my new MacBook Air.

Since I've never built an iPhone application before, let alone used XCode or developed in Cocoa or Objective-C, I'm going to start by building the simplest app possible, the "Hello World" application.

http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhone101/Articles/01_Overview.html#//apple_ref/doc/uid/TP40007514-CH10-SW2

Sunday, June 7, 2009

4. Upgrading Mac OSX - iPhone SDK requires Mac OSX 10.5 (Leopard)



Apparently, Mac OSX 10.5 (Leopard) is required for the iPhone SDK, which means I'll need to reinstall my OS and spend a few extra bucks to get things going. Currently, I am on Mac OSX 10.4.11 (which isn't supported by the iPhone SDK)

My Purchase Summary:

Apple Mac OS X Version 10.5.6 Leopard [5-User Family Pack]: $126.99
Tax: N/A
Shipping: $4.39
Total: $131.38

This Purchase: $131.38 | Running Total: $2954.75

Saturday, June 6, 2009

3. Reviewing the iPhone Human Interface Guidelines

Since it is my goal to eventually get an application published on the Apple Store, I figured it'd be wise to read over what Apple expects from each app in terms of its design and user experience.

http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/MobileHIG/index.html

Time spent: 5 hours

2. Installing the iPhone SDK

Apple will require you to join the iPhone Developer Program first.

It's free and easy. Do it!

http://developer.apple.com/iphone/index.action

1. Purchasing the goods... and getting some frequent flier miles in the process :)


Today I bought a MacBook Air and got an 8GB iPod Touch for free by taking advantage of Apple's "Back to School" special.

* Buy a qualifying Mac and iPod with your Apple education discount from May 27, 2009, through September 8, 2009, and receive an online rebate up to $229, except where otherwise required by state law. Terms and conditions apply. Visit www.apple.com/backtoschool for full details. Not all Apple products qualify for education pricing.

Details: http://store.apple.com/us/browse/campaigns/back_to_school?cid=WWW-NAUS-BTS20090507-00029

On top of that, I got 8000 United Frequent Flier miles. United is currently offering 3 miles for every 2 dollars spent if you access the Apple store through United's Mileage Plus storefront. If you spend $500 between April 10 2009 and June 21 2009, United will reward with with an addition 500 miles on top of that!

Here's a link to the United Mileage Plus storefront: http://links.mponlinemall.com/a/v.x?Token=pjbigcdjnlknmejeealefcebfdhplgeopjjcnpbnheocekhbkmfjblogedgpmgmjoomp


My Purchase Summary:
iPod touch 8GB: $299.00
iPod touch 8GB (mail-in rebate): -$299.00
MacBook Air, 13-inch, Aluminum (1.86 GHz/128GB Solid State Drive): $2,299.00
Apple Mighty Mouse: $49.00
Tax: $238.37
Shipping: Free
Total: $2,823.37

This Purchase: $2,823.37 | Running Total: $2,823.37