某些应用程序(尤其是文件传输应用程序)允许您生成外部文本编辑器以编辑远程文件。他们通过将文件下载到临时目录,使用该文件打开外部编辑器,然后监视文件和/或应用程序状态的更改(例如,当它退出时)并使用这些作为触发器来上传修改后的文件来实现此目的到远程服务器。
我想实现类似的功能(特别是使用 AppleScript 编辑器,尽管我想了解一般情况) - 在 Objective-C/Cocoa 中这样做的好方法是什么?
我应该避免哪些潜在的陷阱?我想中途进行保存会导致一些问题......?
我通过 iOS 编程熟悉了 Objective-C,但刚刚开始接触 Cocoa。
Some applications (especially file transfer apps) allow you to spawn an external text editor in order to edit a remote file. They do this by downloading the file to a temporary directory, opening the external editor with this file, and then monitoring for changes to the file and/or the application state (e.g. when it quits) and use these as triggers to upload the modified file to the remote server.
I would like to implement similar functionality (specifically using AppleScript Editor, though I would like to understand the general case) - what is a good way to go about doing so in Objective-C/Cocoa?
What are some of the potential pitfalls I should avoid? I imagine catching a save halfway through would cause some issues...?
I'm familiar with Objective-C through iOS programming, but have only just started with Cocoa.
发布评论