Oct 15, 2008

Boot Mac OS X from External Drive

Although a tad bit off topic, it’s Mac related none-the-less. I am in the midst of backing up my MacBook Pro to a remote drive as I’ll be buying one of the new machines recently announced by Apple.

As part of the process, I am creating an image of my current system on a USB drive, using the Disk Utility application. The idea is to create a bootable image on the USB drive, verify that I can boot from the drive and use that image for the new machine. If all goes well, the process of configuring my new system such be nothing more than restoring the image on USB to the new system, in theory.
Continue reading...

Oct 13, 2008

JSON Framework

If you’ve found a need to work with JSON (including with the iPhone), I want to point you to an excellent Google code project: http://code.google.com/p/json-framework/. The author of this framework can be found here.

This framework implements a strict JSON parser and generator in Objective-C. It’s easy to work with and can be used across any number of projects with ease.
Continue reading...

Oct 6, 2008

iPhone Mockups with Photoshop

Geoff Teehan at teehan+lax sent me a link to a Photoshop PSD file they created to help quickly create mockups of iPhone applications.

If you’ve spent any amount of time scrambling to create a prototype, you’ll greatly appreciate how much tools such as this can help. The screenshot below gives you an idea of how the assets look in Photoshop.

Here is a link to another PSD from 320480, which was the catalyst for Geoff and his team in creating their own tool.

Oct 3, 2008

How to Uninstall Xcode

A friend in San Francisco, Rodney Aiglstorfer, was recently jumping through hoops to get Xcode to cooperate with his iPhone. There’s nothing more aggravating than having your application running within the simulator and getting stuck downloading to a device.

At one point in the process he opted to remove the Xcode developer tools and start the configuration from the beginning. Which leads to the tip: should you ever find the need to remove Xcode, run the following from within a terminal window to make it happen:

sudo <Xcode>/Library/uninstall-devtools --mode=all

<Xcode> is the directory where the tools are installed. For typical installations the full path is /Developer/Library/uninstall-devtools

Easy enough, just make sure this is what you really intend to do as once it’s gone, it’s gone.

Sep 30, 2008

Xcode and #pragma mark

I’ve started using #pragma mark directives in my code to help with organization as my implementation files grow. #pragma mark is simple to use, for example, insert the following to call out initialization code:

#pragma mark -
#pragma mark Initialization

Continue reading...

Sep 29, 2008

Cocoa Programming – Part III

This is the third and final post in a series reviewing the book Cocoa Programming, by Aaron Hillegass. Here are links to the first and second parts of this review.

In this post I’ll review a few highlights of the book as well as offer a few suggestions (from my perspective) for improvement should another edition be forthcoming. Let’s begin with the highlights.
Continue reading...

Sep 26, 2008

Cocoa Programming – Part II

This post is the second in a series reviewing the book Cocoa Programming, by Aaron Hillegass. This part of the review is dedicated to a closer look at the code examples.

Starting from Chapter 2, the book dives into building relevant code examples. Working with Xcode and Interface Builder, you’ll quickly become familiar with the interface and interaction among both tools. There is even a short segue into the basics of debugging in Chapter 3.
Continue reading...

Sep 23, 2008

Cocoa Programming – Part I

This post is the first in a series reviewing the book Cocoa Programming, by Aaron Hillegass.

Let me begin by saying, Aaron’s know the topic of Cocoa programming. As a previous employee of NeXT which merged with Apple, Aaron has extensive experience teaching developers, including many Apple Engineers, how to write applications for Mac OS X.
Continue reading...

Sep 15, 2008

Xcode Debugging: Reset Current Line

This tip is based on information in the book Xcode 3 Unleashed. I just completed a three part review the book, which you can read here.

When inside a debugger and stepping through code, line be line, have you ever wanted to move to the top of a loop and restart, including resetting counters, without having to restart the application/debugger? Here’s a cool trick you can use within Xcode to do just that. In the figure below, notice that the current value of the variable name is America/Antigua.
Continue reading...

Sep 12, 2008

Minnesota CocoaHeads Recap

The Minnesota CocoaHeads met tonight and it was an interesting spin on development for the Mac. Troy Gaul did a presentation on Adobe Lightroom, from the perspective of the development tools and approach used to create Lightroom.

Although I have heard of Lua , I had no idea of the depth of its usefulness. It was impressive to see the extent it’s used in Lightroom, somewhere in the neighborhood of 60% of the code base. Continue reading...

Sep 11, 2008

Xcode 3 Unleashed, Part III

This post is the third in a series on the book Xcode 3 Unleashed, by Fritz Anderson. I’ll wrap up the review in this post by covering both highlights of the book and suggestions for future editions.

Let’s begin with the highlights of this book, and there are many. You’ll notice from the moment you crack open the book, it’s filled with color. Not just color figures, all code examples are in color, as in, color syntax highlighting. And the colors match what you’ll find in Xcode, how cool is that?
Continue reading...

Sep 10, 2008

Xcode 3 Unleashed, Part II

This post is a continuation of Part I of the book review of Xcode 3 Unleashed, by Fritz Anderson.

Unlike the first section of the book, in the second half all topics are self-contained, that is, they are not tied into one example. This section begins with an in-depth look at working with Xcode projects. You’ll learn about code specific features such as code completion to folding/hiding blocks of code; class related activities such as a class browser and class modeler (visual representation of hierarchies); and optional layouts of content within Xcode, including the default, all-in-one and condensed. Continue reading...

Sep 9, 2008

Xcode 3 Unleashed, Part I

What follows is the first post of three, reviewing the book Xcode 3 Unleashed, by Fritz Anderson.

I hope you’ll find the approach to this review to be informative, as it will definitely be different from other technical book reviews. Much longer than most book reviews, there is a good reason: to provide depth of information about the book, including quality and relevance of the examples/code, describe where the book shines, and also to point out areas for improvement.

I’ll take the time to read the book (cover to cover), work through numerous examples (as in, type in code, compile, run, etc) and share my insight from the perspective of someone who has been in the software business (as a techie) for nearly 20 years. As the author of a technical book, I’ll also be able to put myself in the shoes of the author, which I think can provide for some additional insight regarding what works and what doesn’t in a book. Once the review is complete, I’ll write one or two posts (tips) that are based on information from the book. Let’s get started.
Continue reading...

Aug 20, 2008

Filename and Line Number with NSLog: Part II

In the previous post (on the iPhone Developer Tips blog) I demonstrated a simple debug class that I wrote to wrap some additional code around NSLog. The code allows for displaying additional information beyond the date/time stamp and process ID that NSLog outputs, specifically, the filename which calls the debug routine, and the line number where the call was invoked. I also added a few additional configuration options including an option to disable all debug messages.

You can read the rest of the tip on the iPhone Developer Tips blog.

Aug 19, 2008

Filename and Line Number with NSLog: Part I

Coming from a C development background, long before the days of integrated debuggers, printf() was the primary tool for tracking down bugs. Building on that, NSLog is no doubt helpful. However, as the amount of code in a project grows, I often find that another reference point in the output would be helpful, namely, the filename and line number where the NSLog calls originate.

This is a two part series on creating a new class that wraps NSLog to add several additional debugging features including output of the filename/path, line number information and the option to turn debug messages off/on.

You can read the rest of the tip on the iPhone Developer Tips blog.

Aug 18, 2008

Linking Error: Symbol Not Found

In building a recent project I encountered an error during the linking process. I want to point out the error message and show you how this simple error can be resolved. The reason for pointing out this error is that I have no idea why this error came about…more on that in a moment.

Read the rest of this tip on the iPhone Developer Tips blog…

Aug 15, 2008

Linking Error: CGRectZero and CGRectOffset

I want to share another debugging tip, this something that applies to the final step of building an iPhone project, linking.

I was able to successfully compile a project that I’ve been working on, however, the build process generated an error that two symbols could not be found, CGRectZero and CGRectOffset.

The figure below shows the specific error messages (ignore the first error about .objc_class_name_BirdView for now).

Read the rest of this tip on the iPhone Developer Tips blog…

Aug 14, 2008

Error: syntax error before ‘AT_NAME’ token

I recently ran into this error message within Xcode while writing an iPhone application. I was surprised how long it took to track this down. One of the reasons this is tricky is that message implies that the error occurred in the file referenced in the error message.

Read the rest of this tip on the iPhone Developer Tips blog…