系统环境:Lion正式版10.7.1(build 11B26)
Xcode 4.1.1 (build 4B110)
PS:Xcode 4.1和 4.1.1的区别在于安装界面,本身内容没有变化,build号4B110就是4.1.1的
在全新安装Lion之后,App Store下载安装了Xcode,发现并没有附带iOS和Mac OS X Lion的编程参考文档(Library)。
在Preferences–>Documentation中点击Check and Install Now
iOS 4.3 Library (v. 38.103)
API reference and conceptual documentation for iOS 4.3.
Copyright © 2011 Apple Inc. All rights reserved.
Feed: http://developer.apple.com/rss/com.apple.adc.documentation.AppleiPhone4_3.atom
Web Root URL: https://developer.apple.com/library/ios/
Identifier: com.apple.adc.documentation.AppleiOS4_3.iOSLibrary
Installed Location: /Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiOS4_3.iOSLibrary.docset
Mac OS X 10.7 Core Library (v. 410.26)
Copyright © 2011 Apple Inc. All rights reserved.
Feed: http://developer.apple.com/rss/com.apple.adc.documentation.AppleLion.atom
Web Root URL: https://developer.apple.com/library/etc/redirect/xcode/mac/548/
Identifier: com.apple.adc.documentation.AppleLion.CoreReference
Installed Location: /Developer/Documentation/DocSets/com.apple.adc.documentation.AppleLion.CoreReference.docset
根据得到的版本号和feed地址,使用safari或者firefox打开页面选择最新的版本下载,解压缩到安装目录,如图中所示
然后要修改解压出来的docset所有者信息和文件属性
sudo chown -R -P _devdocs:wheel com.apple.adc.documentation.AppleLion.CoreReference.docset
sudo chmod 775 com.apple.adc.documentation.AppleLion.CoreReference.docset
sudo chown -R -P _devdocs:wheel com.apple.adc.documentation.AppleiOS4_3.iOSLibrary.docset
sudo chmod 775 com.apple.adc.documentation.AppleiOS4_3.iOSLibrary.docset
然后重新启动Xcode,就能查看文档了