Question

I am trying to add help topics to alerts but really don't know how to set the help file . I checked NSAlert class reference in Apple developer site, but there was a tiny amount of information there. I used file paths as well as website urls, but of no avail. I use this code:

NSAlert *alert = [[[NSAlert alloc] init] autorelease];

[alert setMessageText:@"Some error:"];

[alert setInformativeText:@"Some declaration"];

[alert setShowsHelp:YES];

[alert setAlertStyle:NSCriticalAlertStyle];

//This line is my question -> [alert setHelpAnchor : @"http://www.google.com"];

[alert runModal];
Was it helpful?

Solution

The Apple Help documentation is annoyingly out of date and inconsistent. Nevertheless, the Apple Help Programming Guide describes how anchors are added to topics in Apple Help books. Once your help book is registered, indexed with the Help Indexer app and associated with your app, you can use the anchor you specify in the topic you want to jump to. (The Help Indexer app is reached from the Xcode mechanism of downloading more tools from the developer web site.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top