Archive for December, 2005

An important programming tip

Sunday, December 11th, 2005

I learned this the hard way and I wanted others to avoid it. (perhaps I should RTFM)

This may seem obvious to some but:

NSImage *icon1;

if (icon1 == nil)

{

     NSLog(@”this would fail/never print”);

}

As illustrated above, a pointer does not equal nil until you specifically point it there.

The fix:

NSImage *icon1 = nil;

if (icon1 == nil)

{

    NSLog(@”we would get here and then perform our init”);

}

Consider yourself warned :)

The definition of irony

Sunday, December 4th, 2005

I’ve mentioned that I wanted to start a podcast for developing in Cocoa but as of yet it’s not appeared. I went for a road trip back home this weekend and decided to kick-start myself by getting a really good headset with a boom mic for recording.

I decided to go this route because an iSight is a poor source for audio-only recordings (and is quite awkward to get just right) and the built-in mic picks up the fan that kicks on when recording in GarageBand. So I head to the Apple Store (for a power adapter, since I forgot mine in my apartment 500 miles away) and ask if they have any good microphones [seeing as they are an Apple Store, for pros, and podcasting is featured in the iTMS and iTUnes now] “Nope, we don’t carry any.”

Alllrighty. So I jumped over to Best Buy and found a good deal on an Altec Lansing combo. Great sound, noise canceling, excellent boom mic, 5 stars across the board. Needs 2 3.5mm jacks - check (line out/in)

Get home, plug in the headphones and mic and fire up GB to start the first podcast and get *silence* After trying every setting I hop on Google and find the immediate source of the problem - Apple’s line-in jack only supports powered devices, and my headset is definitely out.

The solution? Buy a USB adapter which negates all my savings and also delays the podcast yet again. *sigh*