Objective c 如何在NSSavePanel上默认选择文件类型?

Objective c 如何在NSSavePanel上默认选择文件类型?,objective-c,cocoa,Objective C,Cocoa,如何以编程方式默认选择NSSavePanel中的文件格式 我目前只将其设置为图像类型,但它始终默认为TIFF NSSavePanel *savePanel = [NSSavePanel savePanel]; _saveOptions = [[IKSaveOptions alloc] initWithImageProperties: _imageProperties imageUTType: _i

如何以编程方式默认选择NSSavePanel中的文件格式

我目前只将其设置为图像类型,但它始终默认为TIFF

NSSavePanel *savePanel = [NSSavePanel savePanel];
_saveOptions = [[IKSaveOptions alloc] initWithImageProperties: _imageProperties
                                                  imageUTType: _imageUTType];

[_saveOptions addSaveOptionsAccessoryViewToSavePanel: savePanel];

肯的评论把我引向了正确的方向。传入imageUTType将默认选择NSSavePanel

_saveOptions = [[IKSaveOptions alloc] initWithImageProperties: _imageProperties
                                                  imageUTType:(NSString*)kUTTypeJPEG];

\u imageProperties
\u imageUTType
有哪些值?