FROM : Dave Hersey
DATE : Thu Mar 20 23:31:20 2008
Do you get anything different if you print the object as a pointer
(%p)? Printing it as an int value is... weird.
Try:
printf("Dragged Image: %p\n", (void *)[sender draggedImage]);
or
NSLog(@"Dragged Image: %@", [[sender draggedImage] description]);
I dunno, it may still be nil, but the object you're interested in is
definitely not an int.
- d
On Mar 20, 2008, at 6:15 PM, Nathan Vander Wilt wrote:
> ...
> I subclassed an NSImageView to turn it into a dropbox to help me
> prototype a file-opening feature.
>
> I implemented the following method in my DropBox class:
>
> - (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender {
> printf("Dragged Image: %x\n", (NSUInteger)[sender draggedImage]);
> return NSDragOperationLink;
> }
>
> When I hover any file/folder from the Finder over this drop box, I
> get:
> Dragged Image: 0
> in the debugging console. Likewise if I check it in my prepare/
> performDragOperation, this value is always nil.
>
> The documentation says nothing about this method ever returning nil,
> so it's even more suprising to me that it would *always* return nil.
> I would expect it to give back a reference to the file/folder icon
> image that I'm dragging around underneath the cursor. Is that not
> what this method is documented to do?
>
> thanks,
> -natevw
DATE : Thu Mar 20 23:31:20 2008
Do you get anything different if you print the object as a pointer
(%p)? Printing it as an int value is... weird.
Try:
printf("Dragged Image: %p\n", (void *)[sender draggedImage]);
or
NSLog(@"Dragged Image: %@", [[sender draggedImage] description]);
I dunno, it may still be nil, but the object you're interested in is
definitely not an int.
- d
On Mar 20, 2008, at 6:15 PM, Nathan Vander Wilt wrote:
> ...
> I subclassed an NSImageView to turn it into a dropbox to help me
> prototype a file-opening feature.
>
> I implemented the following method in my DropBox class:
>
> - (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender {
> printf("Dragged Image: %x\n", (NSUInteger)[sender draggedImage]);
> return NSDragOperationLink;
> }
>
> When I hover any file/folder from the Finder over this drop box, I
> get:
> Dragged Image: 0
> in the debugging console. Likewise if I check it in my prepare/
> performDragOperation, this value is always nil.
>
> The documentation says nothing about this method ever returning nil,
> so it's even more suprising to me that it would *always* return nil.
> I would expect it to give back a reference to the file/folder icon
> image that I'm dragging around underneath the cursor. Is that not
> what this method is documented to do?
>
> thanks,
> -natevw
| Related mails | Author | Date |
|---|---|---|
| Nathan Vander Wilt | Mar 20, 22:19 | |
| Sherm Pendley | Mar 20, 23:00 | |
| Nathan Vander Wilt | Mar 20, 23:15 | |
| Dave Hersey | Mar 20, 23:31 | |
| Nathan Vander Wilt | Mar 21, 00:09 | |
| Sherm Pendley | Mar 21, 18:47 | |
| Nathan Vander Wilt | Apr 2, 03:58 |






Cocoa mail archive

