我是一名运行Xcode 5和MacOS X 10.8.5的业余iOS开发人员,我正在制作一款通用应用。我突然在我的iPad故事板上工作,弹出一条消息说
XXXX.storyboard“无法打开。无法确定数据类型。
当我尝试打开它时,它显示了XML源代码,如下所示:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4510" systemVersion="12F37" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="QOo-HH-feM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3742"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="F6O-Ql-rEX">
<objects>
<viewController storyboardIdentifier="ViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="QOo-HH-feM" customClass="ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Pid-s8-44Q"/>
<viewControllerLayoutGuide type="bottom" id="sia-TJ-spg"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="2Vh-FD-gHS">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="JTc-0I-zmE">
<rect key="frame" x="-44" y="-20" width="828" height="1044"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" backgroundImage="6886658738_d647040ce5_o.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="keyboardKiller:" destination="QOo-HH-feM" eventType="touchUpInside" id="Ptv-XD-OwH"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9iy-2x-jn5">
<rect key="frame" x="251" y="589" width="256" height="86"/>
<constraints>
<constraint firstAttribute="height" constant="86" id="Zuv-eF-8mI"/>
<constraint firstAttribute="width" constant="256" id="l2b-Cj-XPD"/>
</constraints>
<fontDescription key="fontDescription" name="CourierNewPSMT" family="Courier New" pointSize="35"/>
<state key="normal" title="Begin Hack" backgroundImage="Unknown.png">
<color key="titleColor" red="0.37254902719999999" green="0.99607849120000003" blue="0.0078431377190000002" alpha="1" colorSpace="deviceRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="hackStarter:" destination="QOo-HH-feM" eventType="touchUpInside" id="eqd-0q-t1S"/>
</connections>
</button>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" editable="NO" text="Phone " selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zZ7-b2-s9Z">
<rect key="frame" x="101" y="30" width="457" height="128"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="textColor" red="0.15686275059999999" green="1" blue="0.0039215688589999999" alpha="1" colorSpace="deviceRGB"/>
<fontDescription key="fontDescription" name="CourierNewPS-BoldItalicMT" family="Courier New" pointSize="130"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" editable="NO" text="Hack" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Jrq-y3-jiw">
<rect key="frame" x="109" y="187" width="457" height="128"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="textColor" red="0.15686275059999999" green="1" blue="0.0039215688589999999" alpha="1" colorSpace="deviceRGB"/>
<fontDescription key="fontDescription" name="CourierNewPS-BoldItalicMT" family="Courier New" pointSize="130"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="Phone.png" translatesAutoresizingMaskIntoConstraints="NO" id="9YA-0f-5Hn">
<rect key="frame" x="478" y="66" width="328" height="261"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder=" Enter phone number here" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="cBm-b5-sUV">
<rect key="frame" x="184" y="515" width="400" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<constraints>
<constraint firstAttribute="width" constant="400" id="xVv-b9-c55"/>
</constraints>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="9iy-2x-jn5" firstAttribute="leading" secondItem="2Vh-FD-gHS" secondAttribute="leading" constant="251" id="2dj-LZ-3tc"/>
<constraint firstItem="JTc-0I-zmE" firstAttribute="leading" secondItem="2Vh-FD-gHS" secondAttribute="leading" constant="-44" id="6nR-9o-oO1"/>
<constraint firstAttribute="bottom" secondItem="JTc-0I-zmE" secondAttribute="bottom" id="8ws-Rb-DN7"/>
<constraint firstItem="JTc-0I-zmE" firstAttribute="top" secondItem="2Vh-FD-gHS" secondAttribute="top" constant="-20" id="ITF-fw-n8Y"/>
<constraint firstAttribute="trailing" secondItem="JTc-0I-zmE" secondAttribute="trailing" constant="-16" id="OHN-hl-liO"/>
<constraint firstItem="9iy-2x-jn5" firstAttribute="top" secondItem="cBm-b5-sUV" secondAttribute="bottom" constant="44" id="URZ-F6-T2k"/>
<constraint firstItem="cBm-b5-sUV" firstAttribute="centerX" secondItem="2Vh-FD-gHS" secondAttribute="centerX" id="dvN-od-bV1"/>
<constraint firstItem="cBm-b5-sUV" firstAttribute="top" secondItem="JTc-0I-zmE" secondAttribute="bottom" constant="-509" id="gXO-U9-ej7"/>
</constraints>
</view>
<connections>
<outlet property="redBoulderRepublic" destination="cBm-b5-sUV" id="K6X-k6-iTf"/>
<segue destination="4Ms-NG-lSK" kind="modal" identifier="SegueOne" animates="NO" id="Npf-11-254"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="bQc-8Z-QvT" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-106" y="-59"/>
</scene>
<!--View Controller - hackScreen-->
<scene sceneID="whK-7q-MxG">
<objects>
<viewController storyboardIdentifier="hackScreen" title="hackScreen" useStoryboardIdentifierAsRestorationIdentifier="YES" id="4Ms-NG-lSK" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="IVQ-eO-0Yy"/>
<viewControllerLayoutGuide type="bottom" id="SsJ-De-fKh"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="UAs-ob-Fij">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="acc-eB-kz2">
<rect key="frame" x="-116" y="0.0" width="1670" height="1194"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<state key="normal">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
</button>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="OKs-vg-G9J">
<rect key="frame" x="26" y="253" width="717" height="70"/>
<color key="backgroundColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.15686275059999999" green="1" blue="0.0039215688589999999" alpha="1" colorSpace="deviceRGB"/>
<fontDescription key="fontDescription" name="CourierNewPSMT" family="Courier New" pointSize="35"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4qS-Lv-5ch">
<rect key="frame" x="20" y="158" width="717" height="70"/>
<color key="backgroundColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.15686275059999999" green="1" blue="0.0039215688589999999" alpha="1" colorSpace="deviceRGB"/>
<fontDescription key="fontDescription" name="CourierNewPSMT" family="Courier New" pointSize="35"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ogk-SE-oK8">
<rect key="frame" x="26" y="358" width="717" height="70"/>
<color key="backgroundColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.15686275059999999" green="1" blue="0.0039215688589999999" alpha="1" colorSpace="deviceRGB"/>
<fontDescription key="fontDescription" name="CourierNewPSMT" family="Courier New" pointSize="35"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="nuo-12-eso">
<rect key="frame" x="26" y="554" width="717" height="70"/>
<color key="backgroundColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.15686275059999999" green="1" blue="0.0039215688589999999" alpha="1" colorSpace="deviceRGB"/>
<fontDescription key="fontDescription" name="CourierNewPSMT" family="Courier New" pointSize="35"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="on3-kl-Z7B">
<rect key="frame" x="26" y="660" width="717" height="177"/>
<color key="backgroundColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.15686275059999999" green="1" blue="0.0039215688589999999" alpha="1" colorSpace="deviceRGB"/>
<fontDescription key="fontDescription" name="CourierNewPSMT" family="Courier New" pointSize="35"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="OZG-KM-65h">
<rect key="frame" x="26" y="891" width="717" height="70"/>
<color key="backgroundColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.15686275059999999" green="1" blue="0.0039215688589999999" alpha="1" colorSpace="deviceRGB"/>
<fontDescription key="fontDescription" name="CourierNewPSMT" family="Courier New" pointSize="35"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="RGY-oq-DYy">
<rect key="frame" x="26" y="457" width="717" height="70"/>
<color key="backgroundColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.15686275059999999" green="1" blue="0.0039215688589999999" alpha="1" colorSpace="deviceRGB"/>
<fontDescription key="fontDescription" name="CourierNewPSMT" family="Courier New" pointSize="35"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" text="Tap anywhere to proceed with hack" translatesAutoresizingMaskIntoConstraints="NO" id="aIu-90-MSl">
<rect key="frame" x="20" y="58" width="717" height="70"/>
<color key="backgroundColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.15686275059999999" green="1" blue="0.0039215688589999999" alpha="1" colorSpace="deviceRGB"/>
<fontDescription key="fontDescription" name="CourierNewPSMT" family="Courier New" pointSize="35"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ptx-VX-CXn">
<rect key="frame" x="-301" y="891" width="1083" height="70"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="ffK-1i-P1M" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="881" y="-73"/>
</scene>
</scenes>
<resources>
<image name="6886658738_d647040ce5_o.png" width="1024" height="768"/>
<image name="Phone.png" width="512" height="512"/>
<image name="Unknown.png" width="198" height="255"/>
</resources>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar" statusBarStyle="lightContent"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>
还要记住,该项目已经在捆绑资源中,已经设置为初始iPad故事板,并且我已经将XML版本设置为2.0和1.0(由于它不能解决问题而将其更改回来)
答案 0 :(得分:2)
检查故事板的属性。
在“标识和类型”部分中,您必须选择XML。将其更改为默认值!