• 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: Dragging examples?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dragging examples?


  • Subject: Re: Dragging examples?
  • From: "Mark's Studio" <email@hidden>
  • Date: Tue, 16 Oct 2001 13:05:15 +0200

Thanks for your reply

I used DragNDropOutlineView example as my source, and i just checked im
wrong setting it twice.

I use [pboard setPropertyList:[self
makeDragString]forType:NSStringPboardType]; because i want the string to
be a PropertyList

and that is working when the string is needed,

but i also want to able save the same PropertyList into a file if i drag
onto the Finder or other app that prefer a file.

So how do i do that?

On tirsdag, oktober 16, 2001, at 11:29 , Andrew Abernathy wrote:

> I can't point you to any examples off the bat, but I can point out an
> issue with your code. Pasteboards only hold a single representation of
> the data for a given pasteboard type. Your code sets the pasteboard's
> NSStringPboardType twice - it should only set it once. Plus, you've put
> it on as NSData and as a property list (only the property list version
> would remain, since you set that last), but NSStringPboardType should
> be put on as a string, like:
>
> [pboard setString:myString forType:NSStringPboardType];
>
> In your case, since you want the Finder to see filename(s), I can't
> actually remember what format it will want (I suspect array, provided
> as a property list).
>
> -andrew
>
>
> On Tuesday, October 16, 2001, at 01:18 AM, Mark's Studio wrote:
>
>> I want to be able to also make a file with the contents of the
>> makeDragString when i drag to the finder,
>> how do i do that, i could not find much information on dragging so an
>> example would be good.
>>
>>
>> - (BOOL)tableView:(NSTableView *)tv writeRows:(NSArray*)rows
>> toPasteboard:(NSPasteboard*)pboard
>> {
>>
>> [pboard declareTypes:[NSArray
>> arrayWithObjects:NSFilenamesPboardType,NSStringPboardType, nil]
>> owner:self];
>>
>> [pboard setData:[NSData data] forType:NSStringPboardType];
>>
>> [pboard setPropertyList:[self makeDragString]
>> forType:NSStringPboardType];
>>
>> return YES;
>> }
>> Thanks
>>
Peter Mark

Mark's Recording Studio A/S
Faelledvej 19 b DK2200 N
Copenhagen Denmark
Tel: +45 35366078 Fax: +45 35366038
www.marks-studio.dk
email@hidden
>> _______________________________________________
>> cocoa-dev mailing list
>> email@hidden
>> http://www.lists.apple.com/mailman/listinfo/cocoa-dev


  • Prev by Date: RE: Q's about Obj-C
  • Next by Date: Re: Q's about Obj-C
  • Previous by thread: Dragging examples?
  • Next by thread: Unable to quit - alloc problem?
  • Index(es):
    • Date
    • Thread