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 7844237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:48:51+00:00 2026-06-02T16:48:51+00:00

I posted this question about dragging content from OS X Finder into an NSTableView

  • 0

I posted this question about dragging content from OS X Finder into an NSTableView. This all works nicely now. However, if I want to drag URLs from a browser address bar into my app, I first need to drag them to the desktop (where they appear as a .webloc file) and then drag them into my app.

Is there a way to directly drag them from the browser address bar into my app, without having to drag them to the desktop first?

I tried registering kUTTypeURL but this doesn’t seem to work as dragged URLs bounce back to their origin:

[[self sourcesTableView] registerForDraggedTypes:[NSArray arrayWithObjects: (NSString*)kUTTypeFileURL, (NSString*)kUTTypeURL, nil]];
  • 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-06-02T16:48:53+00:00Added an answer on June 2, 2026 at 4:48 pm

    In my accepted answer to your other question, the code I provided specifically restricts the URLs that your app can accept to file URLs:

    NSArray* urls = [pb readObjectsForClasses:[NSArray arrayWithObject:[NSURL class]]
     options:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] 
                                         forKey: NSPasteboardURLReadingFileURLsOnlyKey]];
    

    Note the options dictionary containing a boolean YES for the NSPasteboardURLReadingFileURLsOnlyKey.

    If you want to accept any URL, just do this:

    NSArray* urls = [pb readObjectsForClasses:[NSArray arrayWithObject:[NSURL class]]
                                      options:nil];
    

    Or even better, you can require that you’ll accept any URL as long as it is of a particular type, in this case an image:

    NSArray* acceptedTypes = [NSArray arrayWithObject:(NSString*)kUTTypeImage];
    NSArray* urls = [pb readObjectsForClasses:[NSArray arrayWithObject:[NSURL class]]
                                      options:[NSDictionary dictionaryWithObject:acceptedTypes 
                                       forKey:NSPasteboardURLReadingContentsConformToTypesKey]];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just posted this question and learned about <see cref=> , however when i
I posted a question about this earlier, but I have more information now and
I have a question about this question . I posted a reply there but
I have already posted a question about this, but the situation has changed sufficiently
So this morning I posted a confused question about assembly and I received some
I posted this question at ActiveState but got no reply from support or in
A few days ago, I posted this question and this question asking about how
I posted this question and have a freshly minted code signing cert from Thawte.
I'm sure that someone already posted this question; however, I would like to get
Last Updated: 2009-08-11 2:30pm EDT A few days ago I posted this question about

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.