开发者

initialize QTMovie for file dropped in NSTableview

开发者 https://www.devze.com 2023-02-08 15:42 出处:网络
Guys, I\'m just lerning Objective C and writing software for table where I drag mp3 files and want to access their metadata and display artist, genre and etc. So I have class for \"drag and drop\" and

Guys, I'm just lerning Objective C and writing software for table where I drag mp3 files and want to access their metadata and display artist, genre and etc. So I have class for "drag and drop" and class for "access metadata". I think problem is I don't know how to initialize QTMovie for file I dropped from finder to table.

here is line of code:

movie开发者_如何转开发 = [QTMovie movieWithFile:@"/* so, what i should write here??*/" error:nil];

thanks, A.


Basically, your question is just "How do I get a file from drag-and-drop?" Once you know how to get the dropped file, you just pass it into your mystery string. The short answer is that you implement the NSDraggingDestination protocol and in your performDragOperation: method, you ask the drag info object for its propertyListForType:NSFilenamesPboardType.

There's a whole drag-and-drop guide on Apple's website that includes lots of detailed instructions and example code.

0

精彩评论

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