开发者

Create new file with custom file extension?

开发者 https://www.devze.com 2023-03-28 18:06 出处:网络
How can I create a new file with a file format of say .kuy.This file would be holding encrypted data. And then later I could choose tha开发者_如何学JAVAt file with extension .kuy to decrypt. So if I e

How can I create a new file with a file format of say .kuy.This file would be holding encrypted data. And then later I could choose tha开发者_如何学JAVAt file with extension .kuy to decrypt. So if I encrypted soundfile.aup, the encrypted file would be soundfile.aup.kuy, then the user would proceed to decrypting that file in which case the output would be soundfile.aup.

Thank you,

Bobby


You can assign a file extension to your application by going to your Target's info window and selecting the Properties tab:

Create new file with custom file extension?

After that, you just need to add your desired extension when you save a file.


As Steve suggests, first you have to create a custom file format. After that, whenever a custom file gets open - double click or whatever - its path will be passed to application:openFile:. http://developer.apple.com/library/mac/documentation/Cocoa/Reference/NSApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/doc/uid/TP40008592-CH1-SW29

Once you have the path, do your logic and you should be fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消