2013-02-16 1 views
4

모든 것을 두 번 확인했으며 다른 사람이 내가 보지 못하는 어리석은 실수를 찾을 수 있기를 바랍니다.헬프 북의 앵커가 작동하지 않습니다.

내 응용 프로그램에 대한 Apple 도움말 섹션을 작성하려고하는데 올바르게 앵커가 작동하지 않지만 방문 페이지로 이동합니다. 방문 페이지는 index.html이고 다른 페이지는 디렉토리에있는 test.html입니다. index.html을에서

내가 가진 : test.html를에

<a href="help:anchor=support bookID=com.company.app_name.help">Link to another page</a> 

내가 가진 :

<a name="support"></a> 

그래서 여기 내가 지금의 곳에 도착하기 위해 다음 단계입니다 : Apple documentation

AppName.help/ 
    Contents/ 
     Info.plist 
     Resources/ 
      shrd/ 
      English.lproj/ 
       index.html 
       search.helpindex 
       pgs/ 
        test.html 
에 의해 지정된

1) 나는 디렉토리를 구축

2) Apple 설명서에 지정된대로 Help Info.plist를 만들었습니다. Info.plist에 포함되어있는 CFBundleIdentifiercom.company.app_name.help으로 설정했습니다. 내 응용 프로그램의 Info.plist에서

3) 나는 그때 폴더 참조를 만들기 옵션을 선택한 것을 보장하면서 내가 엑스 코드에 내장 된 디렉토리를 복사 AppName.helpCFBundleHelpBookFolder을 설정하고 com.company.app_name.help

4)에 CFBundleHelpBookName 설정 추가 된 모든 폴더에 대해.

5) 그런 다음 도움말 색인 작성자을 사용하여 AppName.help 색인을 생성했습니다. 모든 파일에서 색인 앵커 정보를 선택하십시오..helpindex 파일을 English.lproj 폴더로 복사했습니다.

그게 전부입니다. index.html 파일에 다음 링크를 배치하면 응용 프로그램에 대해 알아 차린 몇 가지 사항이 있습니다. 올바르게 작동합니다.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <title>AppName Help</title> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <meta name="robots" content="noindex" /> 
    <meta name="AppleTitle" content="AppName Help" /> 
    <meta name="AppleIcon" content="../shrd/icon.png" /> 
</head> 
<body> 
    <a href="help:anchor=support bookID=com.company.app_name.help">Link to another page</a> 
</body> 
다음

test.html를위한 코드입니다

<a href="pgs/test.html">Click this link</a>     

또한 여기에 index.html을 내 코드입니다.

<?xml version="1.0" encoding="utf-8" standalone="no"?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
     <title>Testing Links</title> 
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
     <meta name="robots" content="anchors" /> 
    </head> 
    <body> 
     <a name="support"></a>Does linking work?<br/> 

    </body> 
</html> 

여기 내 도움말 파일의 정보 목록은입니다. 나는 또한 변화가 다시 색인 할 디렉토리를 만들 때마다 캐시를 ​​지울 http://www.cocoabuilder.com/archive/cocoa/312037-updating-an-app-help.html :

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
<plist version="1.0"> 
<dict> 
    <key>CFBundleDevelopmentRegion</key> 
    <string>en_us</string> 
    <key>CFBundleIdentifier</key> 
    <string>com.company.app_name.help</string> 
    <key>CFBundleInfoDictionaryVersion</key> 
    <string>6.0</string> 
    <key>CFBundleName</key> 
    <string>AppName</string> 
    <key>CFBundlePackageType</key> 
    <string>BNDL</string> 
    <key>CFBundleShortVersionString</key> 
    <string>2</string> 
    <key>CFBundleSignature</key> 
    <string>hbwr</string> 
    <key>CFBundleVersion</key> 
    <string>2</string> 
    <key>CFBundleHelpBookName</key> 
    <string>AppName Help</string> 
    <key>HPDBookAccessPath</key> 
    <string>index.html</string> 
    <key>HPDBookIconPath</key> 
    <string>shrd/icon.png</string> 
    <key>HPDBookIndexPath</key> 
    <string>search.helpindex</string> 
    <key>HPDBookKBProduct</key> 
    <string>app_name1</string> 
    <key>HPDBookKBURL</key> 
    <string>http://www.company.com</string> 
    <key>HPDBookRemoteURL</key> 
    <string>http://www.company.com</string> 
    <key>HPDBookTitle</key> 
    <string>AppName Help</string> 
    <key>HPDBookType</key> 
    <string>3</string> 
</dict> 
</plist> 

또한이 게시물을 따랐다.

감사합니다.

+0

에게 멋지게 설명 질문을 CFBundleShortVersionString 있습니다. 나는이 주제가 막연하게 다루어 진 것에 동의한다. 해결책을 찾았습니까? 자신의 질문에 대답하는 것은 어떻습니까 (6 개월 전에 기억할 수있는 경우)? – David

답변

4

확실한 David, 미리 감사드립니다.

hiutil -vCaf ./search.helpindex English.lproj 

그러나 나는 인덱스 유틸리티는 모든 시간을 불평한다 실현 한 가지가 &nbsp; 문자가 사용된다 : 나는 인덱스에 다음 명령을 도움말 문서 파일을 실행 내가 기억하고 내 실수 문서에서

. 대신 문자를 대체하십시오 &#32;

제 경우에는 버그라고 생각합니다.

1

만약 모든 것이 적절하고 여전히 도움이되지 않는다면 아래의 코드를 사용하십시오. 보안 문제에 대해 확신하지 못하면 앱에서 파일을 삭제하는 방법을 연구해야 할 수도 있습니다. 때때로 app on upgrade는 도움말 파일을 업데이트하지 않고 새로운 앵커를 포함하지 않는 이전 도움말 파일의 캐시 된 복사본을 표시합니다. 따라서 아래의 코드는 도움말 캐시를 지 웁니다. 또한 당신이 app.plist가 아닌 도움말 번들 안에있는 Info.plist에서 도움말 파일의 빌드 버전을 증가시키는 또 다른 클리너 메소드를 제안합니다. 이러한 필드는 CFBundleVersion

-(void)clearCacheHelp { 
NSArray *arguments1 = [NSArray arrayWithObjects:@"helpd",nil]; 

NSTask * list1 = [[NSTask alloc] init]; 
[list1 setLaunchPath:@"/usr/bin/killall"]; 
[list1 setArguments:arguments1]; 


NSPipe * out1 = [NSPipe pipe]; 
[list1 setStandardOutput:out1]; 

[list1 launch]; 
[list1 waitUntilExit]; 


NSString *home = [self homeDirectory]; 

home = [home stringByAppendingPathComponent:@"Library/Caches/com.apple.helpd"]; 

NSArray *arguments = [NSArray arrayWithObjects:@"-rf",home,nil]; 


NSTask * list = [[NSTask alloc] init]; 
[list setLaunchPath:@"/bin/rm"]; 
[list setArguments:arguments]; 


NSPipe * out = [NSPipe pipe]; 
[list setStandardOutput:out]; 

[list launch]; 
[list waitUntilExit]; 



NSString *home2 = [self homeDirectory]; 

home2 = [home2 stringByAppendingPathComponent:@"Library/Caches/com.apple.helpviewer"]; 

NSArray *arguments2 = [NSArray arrayWithObjects:@"-rf",home2,nil]; 


NSTask * list2 = [[NSTask alloc] init]; 
[list2 setLaunchPath:@"/bin/rm"]; 
[list2 setArguments:arguments2]; 


NSPipe * out2 = [NSPipe pipe]; 
[list2 setStandardOutput:out2]; 

[list2 launch]; 
[list2 waitUntilExit]; 


NSArray *arguments3 = [NSArray arrayWithObjects:@"-rf",@"~/Library/Caches/com.apple.helpd",nil]; 


NSTask * list3 = [[NSTask alloc] init]; 
[list3 setLaunchPath:@"/bin/rm"]; 
[list3 setArguments:arguments3]; 


NSPipe * out3 = [NSPipe pipe]; 
[list3 setStandardOutput:out3]; 

[list3 launch]; 
[list3 waitUntilExit]; 


NSArray *arguments4 = [NSArray arrayWithObjects:@"-rf",@"~/Library/Caches/com.apple.helpviewer",nil]; 


NSTask * list4 = [[NSTask alloc] init]; 
[list4 setLaunchPath:@"/bin/rm"]; 
[list4 setArguments:arguments4]; 


NSPipe * out4 = [NSPipe pipe]; 
[list4 setStandardOutput:out4]; 

[list4 launch]; 
[list4 waitUntilExit]; 


} 
관련 문제