Re: TextEdit features in my Cocoa app
Re: TextEdit features in my Cocoa app
- Subject: Re: TextEdit features in my Cocoa app
- From: Chris Heimark <email@hidden>
- Date: Fri, 19 Oct 2007 14:54:55 -0400
Seems that difficulty lay in use of NSFileWrapper methods
serializedRepresentation & initWithSerializedRepresentation - calls
made on the two sides of a network transport of NSTextView data.
Because I was testing received goods on the same machine as sending
machine, but using different directory structure when sending and
receiving, I needed to perform an NSFileWrapper updateFromPath prior
to laying RTFD back down to disk and subsequent use by receiving
NSTextView. Wow, that was a mouthful!
Anyway, the D&D's are now working correctly.
On Oct 19, 2007, at 10:24 AM, Chris Heimark wrote:
Finally got around to implementing advice in this thread. Namely, I
added two drag delegate methods per the TextEdit sample code, per
below. The sample code runs as expected.
Same code in my application animates but refuses to light up the +
sign, indicating willingness to drop unto Finder, though it will
light a + sign over editor window of XCode (drop leaves no traces
that drop happened). I can open the very same underlying rtfd file
(used in my application) in TextEdit.app and it allows me to drag/
drop any cell element just about anywhere. Visually, my NSTextView
and TextEdit views look identical with same underlying RTFD.
Is there some magical setting I am not making to my NSTextView
object that I am missing? I have noticed one peculiar thing, which
I don't know if it is related, but I noticed
writablePasteboardTypesForCell is called twice, with same
parameters, at the beginning of the drag. Is this a hint to me?
SNIP...
On Sep 17, 2007, at 8:40 PM, Douglas Davidson wrote:
On Sep 17, 2007, at 5:34 PM, Chris Heimark wrote:
Douglas, what do you mean by: "Probably the main problem is that
you need to have a file in the filesystem in order to use
NSFilenamesPboardType." ?
What I mean is that an attachment in the text system ordinarily
has an in-memory copy of the file contents. If you wish to use
NSFilenamesPboardType on the pasteboard in order to copy this to
Finder, you will need to have an on-disk representation. For
example, TextEdit's dragging of attachments in this way works if
the attachment has been saved in an RTFD, but not if it has not
been saved.
Douglas Davidson
_______________________________________________
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