Cocoa/Obj-C - Open file when dragging it to application icon

前端 未结 2 1632
野的像风
野的像风 2021-02-04 17:16

Currently there is a button on my app inteface which allow to open a file, here is my open code:

In my app.h:

- (IBAction)selectFile:(id)sender;
<         


        
2条回答
  •  清歌不尽
    2021-02-04 17:26

    for a quick&dirty solution:

    Cocoa: Drag and Drop any file type

    Tested under Xcode Version 11.4 (11E146) catalina 10.15.4 (19E266)

提交回复
热议问题