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:
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.
精彩评论