2015-08-31 18 views

回答

6
Add **NSExtensionActivationDictionaryVersion** Attributes in your plist file. 

查看此图片以供参考。

enter image description here

1

如果我使用NSPredicate的NSExtensionActivationRule使用?

<key>NSExtensionAttributes</key> 
    <dict> 
     <key>NSExtensionActivationRule</key> 
     <string> 
      SUBQUERY(
      extensionItems, 
      $extensionItem, 
      SUBQUERY 
      (
      $extensionItem.attachments, 
      $attachment, 
      ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.movie" 
      )[email protected] == [email protected] AND [email protected] == 1 
      )[email protected] > 0 
      OR 
      SUBQUERY(
      extensionItems, 
      $extensionItem, 
      SUBQUERY 
      (
      $extensionItem.attachments, 
      $attachment, 
      ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image" 
      || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.png" 
      || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.jpeg" 
      || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.jpeg-2000" 
      || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.tiff" 
      || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.compuserve.gif" 
      || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.microsoft.bmp" 
      )[email protected] == [email protected] AND [email protected] &lt; 6 
      )[email protected] > 0 
</string> 
</dict>