Thanks Gregory, that did the trick.

I actually didn't need your "step 2" (putting the anchors in the Info.plist); using a helpindex worked fine on 10.4. But I did need to explicitly register the help book.

Incidentally, I was able to shortcut the Apple example code slightly using NSPreferencePane's 'bundle' method:

- (void) registerHelpBook
{
        NSString * bundlePath = [[self bundle] bundlePath];
        
        OSStatus err;
        FSRef fsref;

        err = FSPathMakeRef (
                (const void *) [bundlePath UTF8String], & fsref, NULL
        );
        if (err != noErr)
        {
                NSLog (@"Could not get path for bundle - no Apple Help for 
myPrefPane\n");
                return;
        }
        
        err = AHRegisterHelpBook (& fsref);
        if (err != noErr)
        {
                NSLog (@"Could not register Apple Help for myPrefPane\n");
        }
}


PS: I couldn't see any call to deallocate a FSRef. Does it get correctly cleaned up as part of normal stack cleanup?

Not that a small memory leak here would be a big problem, since it's called exactly once.

--
Andrew White

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to