Who? What? When?

I found a problem with the new feature that required a couple of method calls when a new document is loaded. I figured the best place to put these was in the document class in the readFromData:ofType method.

No joy. It turns out the methods I’m calling need data from the sub-classed WindowController object, which hasn’t been instantiated yet. Okay, move the calls to the document’s makeDocumentControllers method, since it looks like the controller has been created and connected by then. Still no joy. I guess this happens asynchronously.

I ended up moving the calls to the windowDidLoad method, in the WindowController sub-class. It’s not as clean as I’d like, since I have to do some checks to see if it’s a brand-new document or a previously-saved document, but it works.

The thing is, this kind of problem has bitten me before. With an AppController, Window Controller, documents, windows, and custom views, I have no idea what happens when. I really need sort of life-cycle chart for the Cocoa document-based app, that tells me which objects are instantiated, and which methods are called, and in what order. Luckily, I don’t (yet?) have a custom NSDocumentController or things could get really messy.

Eating Your Own Hammer

Horizon 1.2 will be out in a couple of weeks, and with it a major new (secret) feature. Now, I’m not sure which saying is more appropriate, “Eating Your Own Dog Food” or “When all you have is a hammer, everything looks like a nail (especially when you made the hammer)” (that last part is mine 😀 ). Anyway, my web server’s logs only go back 5 or 6 days, and then revert to a monthly summary. I want to track daily downloads of Horizon, daily hits to appcast.xml (the file Horizon checks to see if it needs to update itself, and downloads of Horizon.zip (the update-only version of the file.
So, I fired up Horizon, made three categories, turned off the currency formatting, and started entering numbers from the server logs. And what I’ve found is that the new feature makes it really easy to do quick and dirty analysis of these stats.
The secret new feature is in testing right now, and should be ready in a couple of weeks. I hope other people can find new and creative uses for it, too.

1.1.3 is Out!

The big news about 1.1.3 is the French localization. I finally sorted the help book problem. The trick is to put the ‘CFBundleHelpBookName’ tag in each localized InfoPlist.strings, not in the localized Info.plist. In fact, localizing Info.plist does nothing. I finally found this in an Apple document marked ‘Preliminary’ that had last been updated in 2004!
So, I’ve learned my lesson: check over all the documentation carefully.
And there are also two lessons in here for Apple:

  1. Update your documentation! A preliminary doc from 2004 is just not acceptable!
  2. Fix the localization in Xcode! There’s no point in localizing Info.plist if it doesn’t do anything, so don’t let XCode localize it!

Now that localization is sorted out, I can get back to the fun stuff, adding new features. 🙂

@!#%$ Help

I have been struggling to get French and French Canadian versions of help working with my program. The English Help works fine, and the localized versions of the program, apart from the help (strings, currency values and dates) also work fine.

I have added a help folder to each localized folder (fr.lproj and fr_ca.lproj), indexed the Help Books, and adjusted the ‘AppleTitle’ tag accordingly. I have also localized Info.plist, left the ‘CFBundleHelpBookFolder’ alone, and changed the ‘CFBundleHelpBookName’ to match the ‘AppleTitle’ tag.

Now, when I change my locale and run my app, I can select ‘Aide Horizon’ from the ‘Aide’ Menu, and Help Viewer opens with French menu items. But, it does not load the Help Book. However, the Help Book is listed in the Help Viewer ‘Library’ menu, and if I select that the help works fine. This tells me the the Help System has found the Help Book, but not why it’s not loading it.

I have also turned on debugging for the Help Viewer, and compared the loading of the English Help to the request to load the French help. I couldn’t see any error messages or anything significant in the debugging output.

I’ve also been through all the steps in this article with no results.

So, does anyone know how I can fix this, or have any suggestions where I can turn for help? I’ve already asked on the apple-help-authoring list, but I haven’t heard anything back yet.