AHGoToPage function
AHGoToPage function
- Subject: AHGoToPage function
- From: Ian Piper <email@hidden>
- Date: Sun, 08 Nov 2009 01:47:18 +0000
Hi all,
I hope someone can illuminate me. I have been trying to follow the
Developer Documentation example for AHGoToPage. I have connected a
help button in the UI to an action called loadHelpForJournalEntry.
This is intended to load a help file called index.html. The help files
themselves work fine BTW. I have added this function and IBAction:
OSStatus MyGotoHelpPage (CFStringRef pagePath, CFStringRef anchorName)
{
CFBundleRef myApplicationBundle = NULL;
CFStringRef myBookName = NULL;
OSStatus err = noErr;
myApplicationBundle = CFBundleGetMainBundle();// 1
if (myApplicationBundle == NULL) {err = fnfErr; goto bail;}// 2
myBookName = CFBundleGetValueForInfoDictionaryKey(// 3
myApplicationBundle,
CFSTR("CFBundleHelpBookName"));
if (myBookName == NULL) {err = fnfErr; goto bail;}
if (CFGetTypeID(myBookName) != CFStringGetTypeID()) {// 4
err = paramErr;
}
if (err == noErr) err = AHGotoPage (myBookName, pagePath,
anchorName);// 5
bail:
return err;
}
- (IBAction) loadHelpForJournalEntry:(id)sender {
MyGoToHelpPage(CFSTR("index.html"), NULL);
}
The above is copied from the docs, though I had to add the bail: line.
Anyway, this fails with the Build results errors shown below this
message. I think the problem might be that I am not loading the
appropriate library, but I can't figure out what that library is. The
documentation seems to mention AppleHelp.h and refers to importing
<Carbon/Carbon.h> but surely I don't need the Carbon Framework for
implementing help do I?
I'm clearly misunderstanding something - any guidance would be
appreciated.
Thanks,
Ian.
--
Build results errors
--------------------
Build DailyJournal of project DailyJournal with configuration Debug
CompileC build/DailyJournal.build/Debug/DailyJournal.build/Objects-
normal/x86_64/DailyJournal_AppDelegate.o DailyJournal_AppDelegate.m
normal x86_64 objective-c com.apple.compilers.gcc.4_2
cd "/Volumes/repository/scratch/FileMerge tests/Fixed copy"
setenv LANG en_US.US-ASCII
/Developer/usr/bin/gcc-4.2 -x objective-c -arch x86_64 -fmessage-
length=0 -pipe -std=gnu99 -Wno-trigraphs -fpascal-strings -fasm-blocks
-O0 -Wreturn-type -Wunused-variable -isysroot /Developer/SDKs/
MacOSX10.6.sdk -mfix-and-continue -mmacosx-version-min=10.6 -gdwarf-2
"-I/Volumes/repository/scratch/FileMerge tests/Fixed copy/build/
DailyJournal.build/Debug/DailyJournal.build/DailyJournal.hmap" "-F/
Volumes/repository/scratch/FileMerge tests/Fixed copy/build/Debug" "-I/
Volumes/repository/scratch/FileMerge tests/Fixed copy/build/Debug/
include" "-I/Volumes/repository/scratch/FileMerge tests/Fixed copy/
build/DailyJournal.build/Debug/DailyJournal.build/DerivedSources/
x86_64" "-I/Volumes/repository/scratch/FileMerge tests/Fixed copy/
build/DailyJournal.build/Debug/DailyJournal.build/DerivedSources" -
include /var/folders/QW/QWESFte3FhWdBYEpGcMlAU+++TI/-Caches-/
com.apple.Xcode.501/SharedPrecompiledHeaders/DailyJournal_Prefix-
fhphnkdzsgowcjfzywnbpghwpikg/DailyJournal_Prefix.pch -c "/Volumes/
repository/scratch/FileMerge tests/Fixed copy/
DailyJournal_AppDelegate.m" -o "/Volumes/repository/scratch/FileMerge
tests/Fixed copy/build/DailyJournal.build/Debug/DailyJournal.build/
Objects-normal/x86_64/DailyJournal_AppDelegate.o"
/Volumes/repository/scratch/FileMerge tests/Fixed copy/
DailyJournal_AppDelegate.m: In function 'MyGotoHelpPage':
/Volumes/repository/scratch/FileMerge tests/Fixed copy/
DailyJournal_AppDelegate.m:214: warning: implicit declaration of
function 'AHGotoPage'
/Volumes/repository/scratch/FileMerge tests/Fixed copy/
DailyJournal_AppDelegate.m: In function '-[DailyJournal_AppDelegate
loadHelpForJournalEntry:]':
/Volumes/repository/scratch/FileMerge tests/Fixed copy/
DailyJournal_AppDelegate.m:221: warning: implicit declaration of
function 'MyGoToHelpPage'
Ld build/Debug/DailyJournal.app/Contents/MacOS/DailyJournal normal
x86_64
cd "/Volumes/repository/scratch/FileMerge tests/Fixed copy"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
/Developer/usr/bin/gcc-4.2 -arch x86_64 -isysroot /Developer/SDKs/
MacOSX10.6.sdk "-L/Volumes/repository/scratch/FileMerge tests/Fixed
copy/build/Debug" "-F/Volumes/repository/scratch/FileMerge tests/Fixed
copy/build/Debug" -filelist "/Volumes/repository/scratch/FileMerge
tests/Fixed copy/build/DailyJournal.build/Debug/DailyJournal.build/
Objects-normal/x86_64/DailyJournal.LinkFileList" -mmacosx-version-
min=10.6 -framework Cocoa -o "/Volumes/repository/scratch/FileMerge
tests/Fixed copy/build/Debug/DailyJournal.app/Contents/MacOS/
DailyJournal"
Undefined symbols:
"_AHGotoPage", referenced from:
_MyGotoHelpPage in DailyJournal_AppDelegate.o
"_MyGoToHelpPage", referenced from:
-[DailyJournal_AppDelegate loadHelpForJournalEntry:] in
DailyJournal_AppDelegate.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden