Post

Replies

Boosts

Views

Activity

Reply to How to Create a Searchable Help Book with Help Indexer?
The keys in the .plists are displayed differently in XCode than they actually are in the file. For example when you open the application’s .plist in Xcode it shows the CFBundleHelpBookName as Help Book Name. This is not helpful. In the Apple Help Programming Guide these are given as their actual names in the <key> fields so I advise you to open and edit them with an external editor like BBEdit. The CFBundleHelpBookFolder should be appname.help (name of the help bundle). The CFBundleHelpBookName should be the title of the Help Book as it is in the Apple Title meta tag in the home page of the Help Book as it is in the illustration, NOT com.mycompany.appname.help as it says in the text. Because Help Books are cached you will have to clear the cache every time you edit the Help Book with the terminal command rm -rf ~/Library/Caches/com.apple.help* The Apple Help Programming Guide is poor and out of date. An example of how to add a Help book to your application can be found on GitHub: https://github.com/Red-Menace/RubyMotionRonin/tree/master/Help%20Book%20Sample. The Help Indexer application you can download from Xcode Additional Tools is terrible: It can’t open files in a bundle so you have to create your Help Book as a folder and rename it as a .help when you’re done, before adding it to your .xcodeproj. I can follow the instructions to give my application a Help Book but I want it to be searchable. After many hours of trying I find that it’s impossible to do it. The guide says to put the .helpindex in the localized .lproj folder and include its name in the Help Book’s info.plist in the HPDBookIndexPath key. This doesn’t work. Adding a Help Book to a Mac application has been a real PITA for years. This is something that Apple should improve.
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’20
Reply to How to Create a Searchable Help Book with Help Indexer?
Update: Apple is still telling developers to include a Help Book in its User interface guidelines, BUT: Apple help viewer is buggy - some things don't even work. The documentation is terrible and hasn't been updated since a minor change - IN 2013! The Help indexer application is terrible and is from 2015. It is no longer available from Apple. If Apple wants to get rid of Help Books it should just tell us. This is a terrible way to do it and this is a terrible way to treat developers.
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’20
Reply to How to Create a Searchable Help Book with Help Indexer?
Based on posts I found, with newer versions of the OS you have to create an index using the hiutil command in the terminal. The type of index file created by the indexer application won't work. Of course this is completely undocumented. hiutil can create two types if index files. Supposedly you have to create the type that's used by Spotlight. The documentation mentions hiutil and hiutil(1). Although I have been programming the Mac since 1988 I have absolutely no idea of how to use terminal commands so when I type man hiutil into the terminal it's just complete ishcabibble to me. Computers with GUIs were invented so you wouldn't have to deal with very complex command line programming. It seems ironic that I would have to learn ANOTHER very complex technology just to create one file in my application. If anyone has any guidance about what terminal command to enter I'll try it, otherwise I won't bother.
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’20
Reply to How to Create a Searchable Help Book with Help Indexer?
In order to do less typing I set the working directory to the Resources directory in the help bundle, using the chdir pathname command. I use the command: hiutil -Cf Resources/English.lproj/help.helpindex English.lproj This creates a help.helpindex file in the English.lproj folder. As per the documentation the other html files are in a sub directory. To be sure that I'm not looking at a cached version of the application's help I use the terminal command: rm -rf ~/Library/Caches/com.apple.help* The name of the help.helpindex file is in the help bundle's info.plist file in the HPDBookIndexPath dictionary. My application's help is still not searchable. Only the main help page is searchable. When I open the index file with BBEdit I see lots of keywords from the other html files but the Help application won't find them. Using the parameter -Caf doesn't help. it's likely that I need some other file specifier but I can't see what it would be.
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’20
Reply to XCode not creating _MASReceipt/reciept in App Bundle?
Looking at other posts about this problem and my earlier post several years ago, it seems that I created a build phase that created the _MASReceipt folder in the target. This is now gone. I didn't do this so it looks like a bug in XCode. How can I recreate it? This is not likely to solve the problem because the dataWithContentsOfURL crashing the App is certainly a bug. The other thread about this is six months old and there is no solution to this problem.
Mar ’21
Reply to Code 173 no longer triggers receipt generation
I have the same problem, also the code: NSBundle *mainBundle = [NSBundle mainBundle]; NSURL *receiptURL = [mainBundle URLForResource: @"receipt" withExtension: @""]; receiptData = [NSData dataWithContentsOfURL: receiptURL options: NSDataReadingMappedAlways error: &amp;theError]; crashes without logging any errors in the console pane in XCode or the console when I use the dataWithContentsOfURL method and then I start to get all of the application is damaged alerts. How can you test your receipt validation code with this bug? You should file a bug report. Also there are other threads about this.
Topic: App & System Services SubTopic: Core OS Tags:
Mar ’21
Reply to XCode not creating _MASReceipt/reciept in App Bundle?
It started to work again. The debug app isn't crashing when I call the method: URL *receiptURL = [mainBundle URLForResource: @"receipt" withExtension: @""]; anymore and when the receipt validation code calls exit(173), XCode relaunches the app with a dialog for me to enter my test user ID and password, and adds a valid receipt. This MIGHT be because I added a build phase to the target: Copy Files Destination - Wrapper Subpath - @"Contents/_MASReceipt/receipt" If you get the same errors that I did, try the above. Maybe it will solve this problem.
Mar ’21
Reply to setNameFieldStringValue in ModalDialog
Eventually with some difficulty I solved this problem. To make sure that the accessory panel is loaded from the .xib I do this: IBOutlet NSView* accessoryView; if(!accessoryView){ //not loaded yet         NSArray *_Nullable* topLevelObjects = nil; //allocated as nil but doing it explicitly supresses a compiler warning         if([[NSBundle mainBundle] loadNibNamed: @"accessoryView" owner: self topLevelObjects: topLevelObjects] == NO){             myCustomAlert(@"INTERNAL ERROR!", @"Unable to load accessory popup menu xib in Save as dialog.");             return;         }     } I encountered a strange error. If I provide the NSSavePanel with a list of fileTypes like this: NSArray * fileTypes = [NSArray arrayWithObjects: @".tiff", @".pdf", @".jpg", @".png", @".jp2", @".bmp", @".insc", nil]; [savePanel setAllowedFileTypes: fileTypes]; The savePanel will encounter an error when I run it with [NSSavePanel runModal]; When the user selects a different file type from the accessoryView popup menu in the NSSavePanel the method that is executed just does this: [savePanel setAllowedFileTypes: [NSArray arrayWithObject: [[[sender selectedItem] title] lowercaseString]]]; This changes the file extension when the panel is running modal.
Topic: UI Frameworks SubTopic: AppKit Tags:
Apr ’21
Reply to How to Create a Searchable Help Book with Help Indexer?
I created an html help book in a .help bundle in my application and use Help Viewer as I always did years ago. Apple still uses help books in its own applications. The help menu item in the menu bar is linked to firstResponder: showHelp which shows the help book if the Help Book directory Name and Help Book Identifier in the application .plist are the name of the helpbook.help bundle. The MainMenu.xib's file owner is an NSApplication. This provides the showHelp IBAction.
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’21
Reply to XCode 13 - No Help Book
Cleaning and rebuilding the project doesn't help. Restarting XCode or my Computer doesn't help. The project doesn't log any errors but there is one error in the Console: error 18:29:15.933543-0600 HelpViewer volume does not support data protection, stripping SQLITE_OPEN_FILEPROTECTION_* flags An older version of the program shows the Help Book. Is this a new bug in XCode?
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’21
Reply to XCode 13 - No Help Book
To update my application I'll have to create a separate volume on my hard drive and install earlier versions of macOS and XCode. This page:https://developer.apple.com/download/ says that I can do it. It links to another page, https://support.apple.com/en-us/HT208891, that tells how to create a volume and install the earlier OS but there's no link to a description of where to get XCode 12. Does anyone know how to get this?
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’21
Reply to How to Create a Searchable Help Book with Help Indexer?
There is nothing wrong with my help book. When I have problems like this one I tend to think it's my fault and re-read the documentation. My Help Book is configured correctly. The problem is that XCode 13, or more likely macOS Monterey 12.0.1 will only display the Help Book if the application bundle is in the Applications folder. So problem solved, sort of, you can't display the Help Book while debugging your Mac App in XCode. You have to archive it and export it to the Applications folder to see the Help Book. I can't update my application at the App Store anyway because of the infamous exit(173) bug in macOS Monterey. Also the hiutil (Help Indexer app) does nothing in Monterey anyway so don't bother creating a help Index.
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’21