All posts in Programming

Fighting feature creep

Giant-Swiss-Army-Knife-8x6

Feature creep is an easy trap to fall into. As developer and software vendor, you always want to please your users. So when a request comes in and it’s eloquently and nicely laid out, it’s hard to resist. I experienced it so much while working on Run Mate 1.1, which is the main reason why it took me 3 months to publish it.

Never again. I hope.

I have a new weapon against it now — it’s a wonderful thought that Wil Shipley said in an interview for Mac Developer Network podcast:

…Technology is just being too complicated. People just don’t enjoy using it, they don’t get it, they’re not getting the most out of it, they’re not able to use the feature they have and if we radically simplify it, then people suddenly get a lot more out of it.
They actually use more features if you give them less features.

MDN podcast is wonderful resource. I had a large backlog of various podcasts — this Shipley interview is in MDN Show 003 from back in July 2009 — which I have recently cleared out. I never check what is in any of the shows, I like when they surprise me. This interview with Wil is chock full of great thoughts.

Another fantastic feature of the MDN Show is World according to Gemmell where Matt Gemmell picks an UX subject and really, really hummers it down.

Note: Steve Scott, the man who ran MDN, has retired that show and now has a new show called iDeveloper Live. It’s more dynamic than MDN Show (more people) plus it’s recorded live and you can be part of it through the chat.

Protected posts?

As I’m baby stepping through the iPhone SDK development, I encounter some strange stuff. Given the unfortunate (to say the least) circumstance of the NDA still in place as of this writing, I can’t post publicly about it. I can’t ask on forums nor would anyone be allowed to answer. That’s how NDA stuff works.

In order not to lose these stuff and to keep note of problem and solution (if I find one) for future benefit, I’m doing this password-protected posts that I will reveal once NDA is lifted.

Which hopefully will happen’ at some point.

update: it did not take long – just days after I did this, Apple killed the NDA.

Confusing stuff: NSLog and SystemSoundID

In my first attemps with iPhone SDK programming — while working on Running Mate’s early proof of concepts — I tested the playing of short sound effects. That’s where I encountered this strange error:

warning: Unable to read symbols for "/System/Library/Frameworks/UIKit.framework/UIKit" (file not found).
warning: Unable to read symbols from "UIKit" (not yet mapped into memory).

As you can see, this error is entirely meaningless on its own — if this was true, none of apps would work. Which was not the case. This happened with 2.1 final SDK, where I last checked for this.

It turns out that problem was with this line:

C:
  1. NSLog(@"Play sound: %@", _soundID);

where _soundID is of type SystemSoundID. Commenting this line out resolved the problem.

My guess here is that SystemSoundID does not have description properly implemented. %@ should cover any object that accepts description message, so it’s not strange that a beginner would try to log it as given above. And would be mightily confused by the message in the console window, as I was.
I got out of this by commenting out lines of code, one by one, starting from the last one I added.

Hopefully someone else will find this and saves oneself some time and nerves.

How to rename project in Xcode 3.x

I thought this would be a simple thing to do, but apparently not.
There’s no option to copy the state of the project as it is and continue working on it under the new name. The reason I need this is that I’m going through AAron Hillegass’s Cocoa Programming for Mac OS X, 3rd ed. and some of the projects span several chapters, each introducing new concepts. Thus I wanted to have each in the state it was at the end of the chapter, than compare and analyze the differences, to better understand what’s new and improved.

Since no option, we go with manual work.

  1. Copy/rename the folder into new name
  2. Get inside the new folder and rename the .pch and .xcodeproj files
  3. Delete the build folder
  4. Open .xcodeproj file in text editor, like TextMate or TextWrangler. That’s actually a folder, which contains 4 files (you can also right-click and do Show package contents, which will reveal the files)
  5. Open project.pbxproj in text editor and replace all instances of the old name with the new name
  6. Load the project file in XCode, do Build/Clean all targets

Now it should be ready for new build, under new name.

Update (Nov 28, ’10): now there is a simple path: copy into a different folder, open the project and then in Xcode pick Project/Rename menu item. If that fails, there’s always a manual way above.

XSLT processing quirk

This week I encountered, for the second time in recent weeks, a very ugly XSLT quirk. I can’t call it a bug, as I’m relatively new to XSL, but it sure irks me very much. Continue reading, it might save you some sanity.
I must lead you to full page, as the code example can’t feet in the home page space.
Continue Reading →