Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm convinced that documentation for <code>NSPasteboard</code>'s <code>-types</code> is actually faulty. The correct documentation should be something like:</p> <blockquote> <p>An array of <code>NSString</code> objects containing the union of the types of data declared for all the pasteboard items on the receiver, <em>with the addition of old-style, non-UTI type identifiers.</em></p> </blockquote> <p>If you're targeting OS X 10.6+, you should be able to completely disregard <code>NSPasteboard</code>'s <code>-types</code> and focus only on each <code>NSPasteboardItem</code>'s <code>-types</code>, but this requires working exclusively with UTIs.</p> <p>To convert a non-UTI type identifier to a UTI you need to use the <code>UTTypeCreatePreferredIdentifierForTag()</code> function; you also need to know what kind of identifier you already have (<code>kUTTagClassFilenameExtension</code>, <code>kUTTagClassMIMEType</code>, <code>kUTTagClassNSPboardType</code> or <code>kUTTagClassOSType</code>). This type is the first argument to the function. The second is the identifier itself (as a <code>CFStringRef</code>). While the documentation suggests that it's OK to pass <code>NULL</code> for the third argument, it seems to be important to actually pass <code>kUTTypeData</code> when generating these dynamic UTIs.</p> <p>For example, to get the (dynamic) UTI for data with the old-style identifier "WebURLsWithTitlesPboardType":</p> <pre><code>CFStringRef webURLsWithTitlesUTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassNSPboardType, CFSTR("WebURLsWithTitlesPboardType"), kUTTypeData); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload