When I first started out learning about the iPhone Mike recommended this book to me:

Cocoa Programming For MAC OS X (3rd Edition) by Aaron Hillegass

The actual order of what I read and did to learn about the iPhone SDK was:

  • Watched all the introductory videos on the iPhone dev site.
  • Read the Objective-C Programming Guide and made notes on the language.
  • Messed around with code while beginning development of my Whose Turn Is It app.
  • Read the book.
  • Realized all the code I wrote for the Whose Turn Is It app was completely wrong.

I found the book extremely helpful when it came to understanding the relationship between Interface Builder and your code.  Without the book I have no idea how I would have figured out the inner workings of GUI design.  I’m sure there are PDFs on the iPhone dev site that I haven’t read yet that contain the same information as this book, but I doubt they’re written to teach like this book obviously is.  So yeah, get this thing and read it if you’re going to work on the iPhone.  The last few chapters don’t apply to iPhone stuff as much as OS X programming (they get very focused on desktop work), however if you’re going to make any utilities for games like level editors or art asset tweaking stuff then these chapters will pay off too.

 

I’ve been working on the screen for editing user names and group names in the Whose Turn Is It app, and having a bastard of a time trying to figure out how to get the keyboard to show up right away for entering or editing the name.  I wanted to get the screen to look like this:

Edit member name screen

When I designed the screen on paper I figured I’d just be able to plonk a keyboard control on the screen’s view in Interface Builder.  No such luck!  No, it’s actually very simple, but only through hunting and pecking in the documentation did I figure it out:


// Implement viewDidLoad to do additional setup after loading
// the view, typically from a nib.
- (void)viewDidLoad
{
[super viewDidLoad];
[[self textField] becomeFirstResponder];
}

Sending the text field the becomeFirstResponder message activates the keyboard right away (and gets the cursor flashing in the text field).

I’m very torn on what approach I should take on the iPhone SDK documentation.  So far I’m working on a “read information when immediate need arises” model, but this hurts.  It makes it very difficult to predict how long each task I am doing will take.  I would love to switch to actively reading the documentation in detail ahead of time.  I know this would make my life easier, because as I alluded to in previous posts on the iPhone when you do things the right way things just work and work smoothly.  When you go the wrong way then it’s very much the square peg in the round hole.

 

Best office mate ever.

On January 29, 2009, in Life, by admin

Byte

Byte as my office mate is definitely a major perk to working at home.  She follows me everywhere I go, keeps me company, and guilts me into exercising at lunch with walks around the block.  If she only knew how to do market research and could tell me how many units each application in the app store is selling on a monthly basis, THEN she’d be a good dog.

 

Argh the new interface to Perforce is so brutal and painful to use that I think Mike and I should maybe look at the other version control choices we have.  You can’t tell what you’re doing in P4V half the time.

Here’s what I learned while trying to add my “Whose Turn Is It?” app to our perforce depot hosted on Mike’s machine:

  1. If you’ve already made a project, make sure it’s located inside your perforce depot folder structure (i.e. within Perforce’s view of your harddrive).
  2. Clean your project (you don’t want to commit anything generated during the build process).
  3. Read the XCode Source Management Guide so you have an idea what you’re about to do.  This will show you how to set up your repository which is pretty simple.
  4. Follow these instructions for getting the perforce command line client (p4) working on your mac.  DON’T set the P4CHARSET variable in this file if your server is configured to operate in the default non-unicode mode, just have the environment.plist file ready for action.
  5. Use the property list editor to set your P4PORT value.  To do that you will need to make it so finder can see hidden folders which I figured out how to do here.  Then you can drag the .MacOSX folder into the open dialog for property list editor and use it to get at your values.  P4PORT should have a value like this:  <server host>:<server port>
  6. In XCode with your Repository configured you should see something that looks like the picture at the end of this post.  This shows that you’ve got the repository configured to point to the correct location of p4, and that the command line utility is successfully connecting to your perforce server.
  7. Import your project’s folder in the Repository window.  This will take awhile if your perforce server is remote, so be patient.

Here’s what your perforce repository should look like when it’s working in the repository window:

perforce repository

 

Argh! GUI design hell.

On January 29, 2009, in iPhone Development, by admin

I’ve discovered the hard way that all the documents provided by Apple that start with “Guide to …” should really be renamed “Read this before you even THINK of trying to …”

I’m trying to finish development of an application that lets you track who’s turn it is to pay for lunch (or movies or whatever).  I’m developing it mostly for Mike and I to get experience in the process of listing an app on the app store.  What should be a simple app though is turning into a forced boot camp in iPhone development.  Here’s the things I’ve learned so far:

  1. The first thing you should do when developing an app is lay out screen for screen what you want it to look like.  Draw it with the iPhone GUI components, or better yet mock it up with photoshop using this.
  2. Once you’ve got your GUI designed, build an object model for your classes and objects that feed into the GUI components.  Try to keep your objects as simple as possible, because without a doubt they will change and adapt as you learn what’s working and what’s not working for your GUI.
  3. If a major part of your app relies on the functionality of a particular component (for example UINavigationController, or a UITableView) then for god’s sake read the guide for working with that component so that you’re working WITH the sdk, rather than against it.  Generally I’ve found that if you find yourself trying to cram a GUI element into your app and get it connected and doing the right thing then you’re likely doing it wrong.

I’ve definitely decided that once this app is done I’m going to dedicate some time each day to slowly read and learn in detail the inner workings of all these GUI components, because I’m certain that knowing how these things work at every level will help me to generate much higher quality applications at a faster pace.

 

The setup!

On January 29, 2009, in Entrepreneurship, Life, by admin
Office setup

Office setup

Lots of work went into my basement office.  Mathew (my step-son) and I built a sweet cherry stained pine shelf to host some great bookshelf speakers my dad helped me find on Craigslist.  These are some sweet Infinity speakers from the 90s that I got for $90.  They’re plugged into my old Denon receiver and keep me in the tunes and Howard Stern while working.  My wife let me steal the desk from her office, Staples and Ikea filled in the rest of the furniture.

The photos on the wall above the speakers are prints of 3D models made by the artists at Fluid Studios, a startup I was a part of.  I keep them to remember the good times I had working in that environment, to remember the mistakes made there, and to inspire me to never give up.

Lots of other cool knicknacks there.  Buddy Christ from Dogma, a jersey from NHL ’06 (a game I was very proud to work on),  some black and white photos I took of the countryside around my grandfather’s cottage in Saskatchewan.  All meaningless to anyone but me, but combined produce a very welcome environment where I’ve really been enjoying my daily work.

The only thing missing from this picture is my office mate.  I’ll get some pictures of her up tomorrow!

 

Today Nexon announced that they’re closing their Vancouver offices, and another 90 to 100 game developers are now out of work in our city.  On the heels of the Blackbox layoffs (I’ve heard from friends that the number is more like 200 people), this puts roughly 300 developers on the streets fighting for positions that just aren’t present in our city.  That’s a lot of my colleagues out there and I feel really bad for them.  I know it’s not just my industry…  I read some crazy stat that there were 11500 layoffs today.  But it hits hard when it’s the industry you work in, companies you know, and friends and colleagues you used to work with that have families and bills to pay.

So here I am, thinking I’m all smart, voluntarily giving up my job to work at home for no pay.  Either Mike and I are geniuses, or we’ve made a huge mistake that will be very hard to come back from if we fail in our pursuits.  Either we saw this coming and are meeting it head on taking our careers into our own hands, or we’re foolish.  Mike and I talked this over today and agreed that both of our pants are well soiled.  All the doom and gloom we’ve read report that the odds are against us, but luckily we’ve got high spirits.  One of the reasons I’m partnered with Mike though is that he subscribes to my belief that hard work will beat any odds.  Eep!

 

Hmm… Blog eh?

On January 27, 2009, in Uncategorized, by admin

Ok, so don’t tell any of my friends but I started this blog because I decided it’s time for me to upgrade my “web” to whatever this 2.0 crap is.  Apparently there’s value in these things that has escaped me so far.  Like some others I’ve been convinced entirely by the overwhelming numbers against me.  Alright, I give up.  I’m late to the party.  Berate me mercilessly.