Re: Determining an inter-application drag source
Re: Determining an inter-application drag source
- Subject: Re: Determining an inter-application drag source
- From: "Jeffrey J. Early" <email@hidden>
- Date: Fri, 26 Mar 2010 12:51:06 -0400
On Mar 26, 2010, at 11:31 AM, Jens Alfke wrote:
>
> On Mar 26, 2010, at 7:40 AM, Jeffrey J. Early wrote:
>
>> They actually don't have to be inside the library bundle... there's an "Advanced" preference to not copy the original into the library.
>
> In that case, the image file would be visible to other apps. So I might have dragged the photo from the Finder into your app, even though it belongs to an iPhoto library. It doesn’t seem that checking the source of the drag is going to be a reliable indication of whether it belongs to iPhoto.
Excellent point -- thanks. That does prove I'll need a more robust method like querying the iPhoto database directly.
On Mar 26, 2010, at 11:41 AM, Mike Abdullah wrote:
>
> I think you're slightly misunderstanding -draggingSource. It gives you a reference to the object initiating the drag, if that drag was within your app. Would you like it to somehow return a reference to the initiating object *from the other application* somehow? That's pretty much impossible without things getting rather messy.
>
> It seems to me that perhaps you want an additional -draggingApplication method which would return an instance of NSRunningApplication.
No, I think the -draggingSource property should return nil as it does now. It wouldn't at all make sense to get a pointer to an object in other application's memory space.
I was originally just hoping to somehow get the application bundle identifier, but as an extension to NSDraggingInfo your solution makes more sense.
Abstractly, we're passing around references to model objects on the pasteboard -- and the applications represent controllers and views. If we make changes to those objects, we want the controllers to know about those changes. This generally isn't a problem for things like text documents which are re-read each time the user opens them in a application. But for these programs that keep proprietary databases as caches of the model objects, they should probably be using something like FSEvents to check if the files are changing, sort of equivalent to KVO in this case.
Regardless, Jens is right: I need a more robust solution._______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden