• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSURLPboardType broken for dropping files in Panther...?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSURLPboardType broken for dropping files in Panther...?


  • Subject: Re: NSURLPboardType broken for dropping files in Panther...?
  • From: Kurt Marek <email@hidden>
  • Date: Mon, 3 Nov 2003 18:10:36 -0800

Well, I noticed that it doesn't work, although I had no idea it ever worked in Jaguar so it's nice to hear that it's logical to others that files dragged from the Finder have a URL associated with them. I'm writing a new app in Panther and attempted to code in the drop of an image file onto an NSImageView. Files from the Finder do not appear to broadcast the NSURLPboardType. If I use NSFilenamesPboardType then I can get the filename.

My problem is that my model class expects data in the NSURL format. My model is associated with both the NSImageView and an NSTableView. As records are changed by selecting different rows of the table, the NSImageView derives its contents from an NSURL instance in the model via an NSArrayController that is also associated with the tableView. When I associate an image file with the model using a URL from an openPanel, the imageView will change whenever a new row is selected in the table as it should. However, if I drag in an image file using NSFilenamesPboardType and put it into the NSURL instance variable using initURLWithString (?--I can't remember the exact method right now), it works initially, but it fails when the table row selection is changed. In other words, the image shows up fine after the drag, but when I select a different row I get an error that goes something like "cannot create URL from NSImage." I think there is a problem translating the NSString data of NSFilenamesPboardType into a URL. Anyone know how to make this transformation? I got some hint that it has to do with percent signs or something, but I'm still looking and really don't know that much about URLs.

So, Rob, I'll see your problem and raise you one of my own. :)

Kurt



On Nov 3, 2003, at 12:40 PM, Rob In der Maur wrote:

My application has drag and drop functionality of which amongst others
the possibility to drop a file from the Finder onto an NSTableView. In
Jaguar, this application worked without a problem. I registered
NSURLPboardType and could drop any kind of file onto the table and it
would add an entry to the table with the name and location (as I've
coded).
Since upgrading to Panther I noticed file drops don't work anymore.
They are not recognized. Dropping a URL from Safari works without a
flaw.

Question: is something changed in the drag/drop in Panther, or has this
to do with the fact that the Finder is now Cocoa based instead of
Carbon based. Any pointers to updated info is appreciated...

cheers,

- Rob In der Maur

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSURLPboardType broken for dropping files in Panther...?
      • From: mmalcolm crawford <email@hidden>
References: 
 >NSURLPboardType broken for dropping files in Panther...? (From: Rob In der Maur <email@hidden>)

  • Prev by Date: What's the best approach to integrating CVS support into an app?
  • Next by Date: Binding a tableView to ImageAndTextCell?
  • Previous by thread: NSURLPboardType broken for dropping files in Panther...?
  • Next by thread: Re: NSURLPboardType broken for dropping files in Panther...?
  • Index(es):
    • Date
    • Thread