• 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
TextView and attachments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

TextView and attachments


  • Subject: TextView and attachments
  • From: Renaud Boisjoly <email@hidden>
  • Date: Tue, 2 Jul 2002 09:31:15 -0400

Hi all

Being a enwbie, I'm still findig it quite hard to understand all the implications of the TExt system in Cocoa. Here's my current issue, and I've tried to find solutions to this in the archives and documentation to no avail... certainly due to my lack of understanding of the whole thing...

I have a simple app which contains a TextView and I'm trying to implement Drag and Drop and Copy/Paste to support the copying of images dragged into the TextView.

I've got all this to work fine, as long as the document is saved. If I save, I can have access to the cell's image, or the wrapper's filename without problem.

- (BOOL)textView:(NSTextView *)view writeCell:(id <NSTextAttachmentCell>)cell atIndex:(unsigned)charIndex toPasteboard:(NSPasteboard *)pboard type:(NSString *)type

is what I'm using, its fine.

But if the document is not saved, or if images have been moved around in some ways before I drag and drop into another app, I either get the wrong image, or nothing at all. I cannot refer to the filewrapper since it doesn't exist yet.

I seem to recall mentions of saving temp versions of either the document or graphic in /tmp or something, but I cannot find this anywhere anymore.

All I want is for my app to be able to drag an image even if a document was not saved before... but even TextEdit doesn't do this...

Any ideas on what I should be looking into to master this concept?

Thanks for all your help

Renaud Boisjoly
_______________________________________________
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.

  • Prev by Date: Re: Storing generic objects as plists (i.e. plist object persistence)
  • Next by Date: Re: Tips for using template C++ classes and Cocoa
  • Previous by thread: Re: Storing generic objects as plists (i.e. plist object persistence)
  • Next by thread: Re: TextView and attachments
  • Index(es):
    • Date
    • Thread