Opening help in Help Viewer
Opening help in Help Viewer
- Subject: Opening help in Help Viewer
- From: Matt Ridley <email@hidden>
- Date: Wed, 9 May 2001 03:41:35 +0100
Hi folks,
In SimpleCocoaApp (an example Cocoa application from Apple), the
Help menu-item is connected to an action whose implementation is
as follows:
NSString *path = [[NSBundle mainBundle] pathForResource:@"ReadMe"
ofType:@"html"];
if (path)
[[NSWorkspace sharedWorkspace] openFile:path
withApplication:@"Help Viewer"];
The file "ReadMe.html" does exist in the project, is part of the
current target, and has no creator-code (so when double-clicked
it opens in the default application for ".html" files). The
problem is that the code doesn't seem to work; instead, it just
opens the file in the default ".html" application, rather than
in Help Viewer. It's the same whether or not the "ReadMe.html"
is specified as the Help file in the target's Build Options.
Are others seeing this too, or does the above code work for you?
You can get SimpleCocoaApp from developer.apple.com, in the
Cocoa section of the Sample Code area. The code above is
straight from SimpleCocoaApp; it's not mine.
Best,
-Matt
--
Matt Ridley
<
http://www.mattridley.com/>