Tag Archives: objective-c

Writing an Apple Help Book

Writing and distributing Apps for OSX compared to those written for the iOS environment is mostly an entirely new adventure. The underlying code is the same, but the concepts of UI design are radically different. Then there is the entire topic of Help Files, or in the case of OSX, the Apple Help Book.

Having several decades of experience as a software designer, developer and distributor, the concept is not new territory. Deploying it in OSX is, however a new skill to be learned. To help those that follow boil all this down I’m going to expose my personal notes on the subject. These notes were derived while using XCode 4.2, in January 2010 [ Detailed Online Information at developer.apple.com ]

Why Apple Help Book?

Flexibility — Writing and deploying an Apple Help Book with the application provides indexed search capability of the Help data, via the OSX Help menu while running the App. Once registered in the Application package itself, it integrates smoothly into the user experience.

What is special about Apple Help Books

They are HTML based. — This makes production of help files for the Application simple. HTML editors are widely available for those that do not have the technical chops to produce the file the good old fashioned way.

Rich Content — Help books can contain video content and even Apple Script to automate help navigation or even perform application manipulation directly from the Help construct. Niiiiiice.

What is a Help Book?

HTML Content — The book consists of a collection of HTML files that constitute the Help documentation for your application.

Indexing Help — Apple provides Help Book Indexing tool located in /Developer/Applications/Utilities, when the Developer package is installed. .

Help API — Contextual help is made available, from the Help Book via a provided Apple Help API. You do not need to utilize this capability for basic help function, but it’s available for advanced Help capabilities.

Exact Match Search for small words — A common problem with basic search functions, is that small or common letter groups may product far to general of a response. Example would be searching for the term ‘CD’. A Help Book with the properly configured Exact Match Searching would be able to return targeted help results for ‘CD’.

Can live In the Cloud — Concept of Apple Help supports the ability to access and deliver content from remote servers (aka the cloud), in three different ways; Internet-only, Internet-primary and Local-primary. It also has the ability to signal need to download and updated Help file for local (end-user) storage.

Links to Online Resources — It’s perfectly acceptable to code the Help Book and it’s title items to be links to locations on the web. An example of this might be a link from the Help system back to the producer’s main website for support or additional help content.

Authoring a Help Book

Full Document Online –[ Click Here ] for the full article on Apple’s Developer Website.

iPhone App2, App3 & App4 compiled – this time in pure Objective-C

App 2


Well, here it is in amazing glory. The 2nd version of that good old programming stallwort, the “Hello World!” example application.

Now this one took me a bit longer to code and implement, HOWEVER, it’s pure Objective-C, not the hybrid app type that I used in Application #1. App1 was interesting, and fast to build, but it relies upon some pretty big external libraries. Not a big deal for a low-intensity application like I’m building right now, but the QuickConnect based hybrid app I first built comes with that (I think is) is a pretty high price to pay (with a couple of hefty line items)

  1. Every time you start the application, I get an unwanted QuickConnect Family Application splash screen. NO THANKS! I’m pretty sure I could hack around it, buy why bother, for now?
  2. It won’t run from XCode! I can get it to start, but it won’t actually Do anything.
  3. The hybrid HTML based application’s style sheets are partially ignored, things like the background and text colors are not honored, BUT the font family is. Very strange
  4. It’s a MAJOR pain in the ass to debug when you create it in DashCode… ‘deploy it’. Have to monkey around with several files to fill the XCode (Objective C based) language into using files it did not expect to need… it’s all very hacky and more kludgy than I like.

Honestly, with XCode view based building, I don’t think I need to mess around with the hybrid application model at all, at least for now. So.. the application that I built purly in HTML, CSS and JavaScript will be shelved for now. Instead I’m going to re-open my Objective C tutorials and work my way into the project I was working on originally.

It might be a pain in the butt to learn Objective-C, but in the end, I benefit. Question is, do I have the time and will to see it all the way through. I believe so. But until such time as I have the first application built and deployed on my phone.. it’s sort of.. moot. No?


App 3

App3

This one is not a View Based Application like number one, but this is what is called a Navigation Based Application.

Now, ever the hacker, I went beyond the code changes to RootViewController.m suggested in the book, and also had to fix some GLARING errors in the text (did they not have an editor look at this??). Anhow, this is the code that I wrote for the cell builder. The enhancements allow line wrap, and I changed the default font size from 17 to 13.


// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.textLabel.lineBreakMode = UILineBreakModeWordWrap;
cell.textLabel.numberOfLines = 0;
cell.textLabel.font = [UIFont fontWithName:@"Helvetica" size:13.0];
}

cell.textLabel.text = @"This is my second Objective-C application.\nDespite the tutorial having MASSIVE bugs, I got it to run!"; // Configure the cell.

return cell;

}

I’m trying to decide if a View Based (winning so far) or a Navigation Based application will be the way I go for the Real Application. The Navigation Based app is a lot easier to get started with, and does not require that rather odd method of linking elements with the fishing line drag and connect method in the View Application.

Still a lot of code to write before I have enough experience to make a solid choice.


App 4

App4 is a derivative work of App3, but this time by simply enabling this little block of code, I get an Edit button and the ‘Delete’ context, if I need it, for the items. Pretty slick. Apple really went out and did a nice job on this SDK…

- (void)viewDidLoad {
[super viewDidLoad];

// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

Application 4 running in the iPhone simulator