保存,文档扩展和首选项(Info.plist)

use*_*809 3 xcode objective-c save plist xib

我有一个简单的基于文档的Cocoa应用程序调用"RaiseMan".当我去保存文件时,控制台中会显示以下消息:

-[NSDocumentController fileExtensionsFromType:] is deprecated, and does not work when passed a uniform type identifier (UTI). If the application didn't invoke it directly then the problem is probably that some other NSDocument or NSDocumentController method is getting confused by a UTI that's not actually declared anywhere. Maybe it should be declared in the UTExportedTypeDeclarations section of this app's Info.plist but is not. The alleged UTI in question is "com.bignerdranch.raiseman-doc".

如果我将当前文件保存为"测试",则会显示一个以.plist打开的文件,并且不会使用Raiseman应用程序打开.如果我将其保存为"Test.rsmn"(明确键入扩展名),则将其保存为Raiseman类型文件,但是当我重新打开文件时,我无法访问任何用户首选项或首选项面板(.xib) .

背景:我目前正在通过Aaron Hillegass的Mac OS X编程,第13章......

use*_*809 5

因此,为了达到预期的效果,我确保在项目目标的属性检查器下,标识符和UTI类型(在文档类型表中)以及.plist文件中的UT类型标识符都是相同的<key>UTTypeIdentifier</key> <string>"com.yourDomainName.ProductName"</string>.

  • 实际上,只是"导入UTI". (2认同)