2012-06-19 2 views
1

iPhone 메일 응용 프로그램에서 .ppt 개의 파일을 읽고 싶습니다. 이미 SO question을 사용하여 PDF 파일을 읽었습니다. 괜찮 았는데,이 코드를 메일 앱에서 메뉴를 생성하는 데 사용했습니다.iPhone 메일 및 Safari에서 ppt 파일을 가져 오는 방법은 무엇입니까?

<key>CFBundleDocumentTypes</key> 
<array> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>PDF Document</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>CFBundleTypeRole</key> 
     <string>Viewer</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>com.adobe.pdf</string> 
     </array> 
    </dict> 
</array> 
<key>UIFileSharingEnabled</key> 
<true/> 
<key>CFBundleDocumentTypes</key> 
<array> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>Powerpoint</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>CFBundleTypeRole</key> 
     <string>Viewer</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>com.microsoft.powerpoint.ppt</string> 
     </array> 
    </dict> 
</array> 

괜찮 았습니다. 내가 문제를 봤어,하지만 누군가가 날 첨부 파일에서 .ppt 파일을 감지하는 방법을 안내 할 수 있다면 도움이 될 것입니다.

답변

1

PPT 파일을 사용하려면 UTI에 맞게 의도를 선언해야합니다. 즉, com.adobe.pdf에 대한 비트를 com.microsoft.powerpoint.ppt으로 간단히 변경해야합니다. 쉬운.

모든 용도와 목적으로 CFBundleTypeNamePowerpoint으로 변경하십시오.

+0

지금 코드를 업데이트합니다. 이제는 pdf 파일이 작동하지 않습니다. 친절하게 내가 잘못하고있는 곳을 말해줘. –

0

여기서 문제는 pdfppt과 같이 전체 CFBundleDocumentTypes 항목을 복제하지 말아야한다는 것입니다.

대신 이러한 블록 중 하나만 필요하며 단순히 CFBundleTypeName을 추가하기 만하면됩니다.

그래서, 당신의 plist는 다음과 같이한다 : 나는 두 항목을 추가 할 때까지 나는 CFBundleDocumentTypes 배열을 끝나지 않았다

<key>CFBundleDocumentTypes</key> 
<array> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>PDF Document</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>CFBundleTypeRole</key> 
     <string>Viewer</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>com.adobe.pdf</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>Powerpoint</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>CFBundleTypeRole</key> 
     <string>Viewer</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>com.microsoft.powerpoint.ppt</string> 
     </array> 
    </dict> 
</array> 
<key>UIFileSharingEnabled</key> 
<true/> 

알 수 있습니다.

관련 문제