Enchilada
Enchilada

Reputation: 3919

Adding Help to a Cocoa App

I want to add a simple one-page HTML page help to my Cocoa app. Can you tell me how to do it? I assume I just have to throw in one lousy .html (and maybe one .css?) file somewhere into my Cocoa project in Xcode?

Upvotes: 13

Views: 6528

Answers (3)

Rob Keniger
Rob Keniger

Reputation: 46020

Creating Apple Help documents that are opened in the Help viewer is straightforward but you must follow the directions in the documentation exactly.

Help files are HTML but you need to place a couple of special tags in the page and name the files in a particular way.

It's all explained in the documentation.

Upvotes: 11

PerfectGamesOnline.com
PerfectGamesOnline.com

Reputation: 1778

Today I've been facing the same problem. I found no up-to-date howto so here is one of my own. Help is nicely working with this Step by Step to create Apple Help in your Cocoa Xcode Application.

Upvotes: 6

Alex
Alex

Reputation: 26859

If you only want a single HTML page and not a proper help file, you could add an HTML document and CSS file to your project. These will be copied to your application's Resources directory inside the app bundle when you compile the project. To load the document, you'll need to get its address. This is actually quite easy:

NSString *helpFilePath = [[NSBundle mainBundle] pathForResource:@"YourHelpDocumentHere" ofType:@"html"];
NSURL *helpFileURL = [NSURL fileURLWithPath:helpFilePath];

The resulting URL will be a file URL that a WebView can display inside your application, or you can pass it off to the operating system using NSWorkspace and it will be opened in the user's default web browser.

Upvotes: 2

Related Questions