Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6859279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:15:48+00:00 2026-05-27T02:15:48+00:00

I have a Drag/Drop NSView which should accept the same file types and extensions

  • 0

I have a Drag/Drop NSView which should accept the same file types and extensions that I have listed in my plist under the key CFBundleDocumentTypes. The app accepts any type of video file, folders and several file extensions that aren’t picked up by the public.movie type.

The (rather long) list of CFBundleDocumentTypes is:

    <key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>Folder</string>
        <key>CFBundleTypeOSTypes</key>
        <array>
            <string>fold</string>
        </array>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>
    <dict>
        <key>CFBundleTypeName</key>
        <string>Movies</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>public.movie</string>
        </array>
    </dict>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>flv</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>Flash Video File</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>ram</string>
            <string>rm</string>
            <string>rmvb</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>RealPlayer Media Files</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>vob</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>VOB File (DVD Video)</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>ogm</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>Ogg MPEG-4 Video File</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>ogv</string>
        </array>
        <key>CFBundleTypeMIMETypes</key>
        <array>
            <string>video/ogg</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>Ogg Video File</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>axv</string>
        </array>
        <key>CFBundleTypeMIMETypes</key>
        <array>
            <string>video/annodex</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>Annodex Video File</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>avi</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>AVI container</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>mov</string>
            <string>moov</string>
            <string>qt</string>
        </array>
        <key>CFBundleTypeMIMETypes</key>
        <array>
            <string>video/quicktime</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>Apple QuickTime container</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>divx</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>DivX file</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>dv</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>DV file</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>wmv</string>
            <string>wm</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>Windows Media Video</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>mpg</string>
            <string>mpeg</string>
            <string>mpeg1</string>
            <string>mpeg2</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>multiplexed MPEG-1/2</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>m1v</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>MPEG-1 Video File</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>ts</string>
            <string>m2ts</string>
            <string>mts</string>
            <string>mt2s</string>
        </array>
        <key>CFBundleTypeMIMETypes</key>
        <array>
            <string>video/mp2t</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>MPEG-2 Transport Stream</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>m2v</string>
            <string>mpv</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>MPEG-2 Video File</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>mp4</string>
            <string>mpeg4</string>
            <string>m4v</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>MPEG-4 File</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>3gp</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>3GPP File</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>mkv</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>Matroska Video File</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>webm</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>WebM Video File</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
    </dict>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>nuv</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>NuppleVideo File</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
        <key>LSTypeIsPackage</key>
        <false/>
        <key>NSPersistentStoreTypeKey</key>
        <string>Binary</string>
    </dict>
</array>

I am already able to verify drop acceptance in my NSView’s draggingEntered method, but I want to be able to run through the Info.plist entries for CFBundleDocumentTypes instead of duplicating all the entries in this method. How can I do this so that my view accepts the exact same files as listed in the CFBundleDocumentTypes entry?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:15:49+00:00Added an answer on May 27, 2026 at 2:15 am

    Just ask your bundle for the information:

    NSArray* documentTypes = [[[NSBundle mainBundle] infoDictionary]
                                        objectForKey:@"CFBundleDocumentTypes"];
    

    This will return an array of dictionaries, one for each of the file types, from which you can easily extract the other information:

    for(NSDictionary* docInfo in documentTypes)
    {
        NSArray* fileExtensions = [docInfo objectForKey:@"CFBundleTypeExtensions"];
        //do something with this info
    }
    

    You could use this in conjunction with the -documentClassForType: method of NSDocumentController. This takes the value from the CFBundleTypeName Info.plist key as the type.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a nested list with drag/drop functionality. My issue is that I
i have a treview control with drag&drop functionality that response to draw the node
I have Drag/Drop functionality in my page embedded using YAHOO.js which is initalized at
I have a drag/drop operation on a Canvas that is supposed to do something
I have a drag and drop script using an older version of jquery which
i have done drag and drop using with jquery. here i have issue that
i have some drag and drop items, which are just draggable vertically within my
I have an NSView subclass which registers for drag files in init method like
I have a drag and drop application (which allows users to organize their files)
We have implemented a drag and drop feature that shows a nice simple representation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.