2013-10-24 1 views
1

나는이 벽에 머리를 맞고 있는데, 사용자 정의 UTI 작업을 할 수없는 것 같습니다.iOS7 Custom UTI

내 앱에서 AirDrop을 구현하기 위해 노력 중이므로 기기간에 파일을 공유 할 수 있습니다. 나는 파일을 다른 장치에 성공적으로 전송할 수 있지만 내 응용 프로그램을 설치 한 다른 장치는 내 응용 프로그램의 파일을 열지 않습니다. 여기

내 app.plist에서 덤프입니다 :

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
<plist version="1.0"> 
<dict> 
    <key>CFBundleDevelopmentRegion</key> 
    <string>en</string> 
    <key>CFBundleDisplayName</key> 
    <string>MYAPP</string> 
    <key>CFBundleDocumentTypes</key> 
    <array> 
     <dict> 
      <key>CFBundleTypeIconFiles</key> 
      <array> 
       <string>57x57</string> 
      </array> 
      <key>CFBundleTypeName</key> 
      <string>MYAPPNAME Shared Assignment</string> 
      <key>CFBundleTypeRole</key> 
      <string>Editor</string> 
      <key>LSHandlerRank</key> 
      <string>Owner</string> 
      <key>LSItemContentTypes</key> 
      <array> 
       <string>com.MYAPPNAME.SIAASSIGNMENT</string> 
      </array> 
     </dict> 
    </array> 
    <key>CFBundleExecutable</key> 
    <string>${EXECUTABLE_NAME}</string> 
    <key>CFBundleIcons</key> 
    <dict> 
     <key>CFBundlePrimaryIcon</key> 
     <dict> 
      <key>CFBundleIconFiles</key> 
      <array> 
       <string>57x57 2.png</string> 
       <string>114x114 2.png</string> 
       <string>72x72 2.png</string> 
       <string>144x144 2.png</string> 
      </array> 
     </dict> 
    </dict> 
    <key>CFBundleIdentifier</key> 
    <string>com.MYAPPNAME.${PRODUCT_NAME:rfc1034identifier}</string> 
    <key>CFBundleInfoDictionaryVersion</key> 
    <string>6.0</string> 
    <key>CFBundleName</key> 
    <string>${PRODUCT_NAME}</string> 
    <key>CFBundlePackageType</key> 
    <string>APPL</string> 
    <key>CFBundleShortVersionString</key> 
    <string>4.0</string> 
    <key>CFBundleSignature</key> 
    <string>????</string> 
    <key>CFBundleVersion</key> 
    <string>4.0</string> 
    <key>LSRequiresIPhoneOS</key> 
    <true/> 
    <key>NSMainNibFile</key> 
    <string>Main_Window</string> 
    <key>NSMainNibFile~ipad</key> 
    <string>Main_Window_iPad</string> 
    <key>UIBackgroundModes</key> 
    <array> 
     <string>fetch</string> 
     <string>remote-notification</string> 
    </array> 
    <key>UIRequiredDeviceCapabilities</key> 
    <array> 
     <string>armv7</string> 
    </array> 
    <key>UIStatusBarTintParameters</key> 
    <dict> 
     <key>UINavigationBar</key> 
     <dict> 
      <key>Style</key> 
      <string>UIBarStyleDefault</string> 
      <key>Translucent</key> 
      <false/> 
     </dict> 
    </dict> 
    <key>UISupportedInterfaceOrientations</key> 
    <array> 
     <string>UIInterfaceOrientationPortrait</string> 
    </array> 
    <key>UISupportedInterfaceOrientations~ipad</key> 
    <array> 
     <string>UIInterfaceOrientationPortrait</string> 
    </array> 
    <key>UTExportedTypeDeclarations</key> 
    <array> 
     <dict> 
      <key>UTTypeConformsTo</key> 
      <array> 
       <string>public.text</string> 
      </array> 
      <key>UTTypeDescription</key> 
      <string>MYAPPNAME Shared Assignment</string> 
      <key>UTTypeIdentifier</key> 
      <string>com.MYAPPNAME.SIAASSIGNMENT</string> 
      <key>UTTypeSize320IconFile</key> 
      <string>72x72</string> 
      <key>UTTypeSize64IconFile</key> 
      <string>57x57</string> 
      <key>UTTypeTagSpecification</key> 
      <dict> 
       <key>com.MYAPPNAME.SIAASSIGNMENT</key> 
       <array> 
        <string>SIAASSIGNMENT</string> 
           <key>public.mime-type</key> 
           <string>application/xml</string> 
       </array> 
      </dict> 
     </dict> 
    </array> 
</dict> 
</plist> 

내가이 일을하는 많은 다른 것들을 시도했다, 난 그냥 iOS7에이 내 파일 형식임을 인식 얻을 수없는 것. 나는 당신이 UTI를 위해 'public.xxx'네임 스페이스를 사용하지 않아도된다는 것을 알고 있습니다. 도움이 될 것입니다.

+0

유형을 공개로 설정하지 않으셨습니까? *? – RyanR

+0

public.text를 사용하지 않습니까? –

+0

예, 문제와 관련이 있는지 확인하는 실험입니다. – RyanR

답변

3

iOS에서 응용 프로그램을 열 수있는 옵션으로 표시 할 수 있도록 declare the types as imported을 확인하십시오.

또한 AirDrop 또는 문서 상호 작용 컨트롤러를 통해 파일을 수신하려면 -application:openUrl:sourceApplication:annotation:을 구현해야합니다.

+0

그래서 나에게 트릭이 있었지만 UTTypeTagSpecification 노드를 "com.MYAPPNAME.SIAASSIGNMENT"에서 변경해야했습니다. "public.filename-extension"을 입력하십시오. –