home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / NeXT / Misc / HigherEducationMailbox.mbox / Archives_provide_val_.attach / May_91 / appkit.463 < prev    next >
Text File  |  1991-05-21  |  2KB  |  26 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\fswiss Helvetica;}
  2. \paperw12380
  3. \paperh7200
  4. \margl120
  5. \margr120
  6. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ul0\fs28 pasteboard timeout paste board time readType\
  7. \
  8. Q:  The Pasteboard sometimes returns nil when I ask it for data--what might this mean?\
  9. \
  10. Q:  Should I check the Pasteboard return value when asking it for data?\
  11. \
  12. Q:  My program crashed when I pasted from the Pasteboard--what might have gone wrong?\
  13. \
  14. A:  When you use the readType:data:length: method to get data from the Pasteboard, the inter-process communication done to get the data might time out.  This would normally happen if the copier put the data in the Pasteboard lazily, but then was very slow in providing the data when another app finally did the paste.\
  15. \
  16. When such a timeout happens, the readType:data:length: method will return nil.  Apps should check this return value, and probably put up some alert about not being able to get the data, since the copier is either slow or dead, and that it might work if you try again later.  NOTE: Apps should NOT try to use the data returned, since they will indirect through a nil ptr and coredump!\
  17. \
  18. You should check the return value for another reason: someone could put something new in the Pasteboard between the time you enquire the type list and ask for data.  In this case your data is no longer there, and you'll get a nil back.  This is documented in the spec sheet at least.\
  19. \
  20. QA463    \
  21.         \
  22. Valid for 1.0\
  23. Already documented in 2.0\
  24. \
  25.  
  26.