首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >“无法解压缩名为UITableViewController的元素”

问“无法解压缩名为UITableViewController的元素”
EN

Stack Overflow用户
提问于 2012-03-09 06:50:50
回答 1查看 1.7K关注 0票数 3

我一直在按照“构建你的第二个iOS应用”教程一步一步地走,在教程承诺所有错误都会消失后,我遇到了这个错误,但直到其他错误都被纠正并尝试编译它时,错误才出现。

错误:

代码语言:javascript
复制
The document "MainStoryboard_iPhone.storyboard" could not be opened. Failed to unarchive element named "UITableViewController".

这里有一个tutorial的链接。

这是我的XML格式的故事板

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="1.1" toolsVersion="2182" systemVersion="11D50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="3">
<dependencies>
    <deployment defaultVersion="1296" identifier="iOS"/>
    <development defaultVersion="4200" identifier="xcode"/>
    <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1179"/>
</dependencies>
<scenes>
    <!--Navigation Controller-->
    <scene sceneID="11">
        <objects>
            <placeholder placeholderIdentifier="IBFirstResponder" id="10" sceneMemberID="firstResponder"/>
            <navigationController id="3" sceneMemberID="viewController">
                <navigationBar key="navigationBar" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="4">
                    <autoresizingMask key="autoresizingMask"/>
                </navigationBar>
                <connections>
                    <segue destination="12" kind="relationship" relationship="rootViewController" id="19"/>
                </connections>
            </navigationController>
        </objects>
        <point key="canvasLocation" x="-1" y="64"/>
    </scene>
    <!--Hello World Master View Controller - Master-->
    <scene sceneID="18">
        <objects>
            <placeholder placeholderIdentifier="IBFirstResponder" id="17" sceneMemberID="firstResponder"/>
            <tableViewController storyboardIdentifier="" title="Master" id="12" customClass="HelloWorldMasterViewController" sceneMemberID="viewController">
                <tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="13">
                    <rect key="frame" x="0.0" y="64" width="320" height="416"/>
                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                    <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                    <prototypes>
                        <tableViewCell contentMode="scaleToFill" selectionStyle="blue" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="BirdSightingCell" textLabel="phq-AM-6qj" detailTextLabel="d2j-B0-0IP" style="IBUITableViewCellStyleSubtitle" id="lJ0-d7-vTF">
                            <rect key="frame" x="0.0" y="22" width="320" height="44"/>
                            <autoresizingMask key="autoresizingMask"/>
                            <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
                                <rect key="frame" x="0.0" y="0.0" width="300" height="43"/>
                                <autoresizingMask key="autoresizingMask"/>
                                <subviews>
                                    <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Bird Sightings" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="phq-AM-6qj">
                                        <rect key="frame" x="10" y="2" width="123" height="22"/>
                                        <autoresizingMask key="autoresizingMask"/>
                                        <fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
                                        <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
                                        <color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
                                    </label>
                                    <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Subtitle" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="d2j-B0-0IP">
                                        <rect key="frame" x="10" y="24" width="47" height="18"/>
                                        <autoresizingMask key="autoresizingMask"/>
                                        <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                        <color key="textColor" red="0.50196078431372548" green="0.50196078431372548" blue="0.50196078431372548" alpha="1" colorSpace="calibratedRGB"/>
                                        <color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
                                    </label>
                                </subviews>
                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
                            </view>
                            <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                            <connections>
                                <segue destination="21" kind="push" identifier="ShowSightingDetails" id="w1o-hR-DXB"/>
                            </connections>
                        </tableViewCell>
                    </prototypes>
                    <sections/>
                    <connections>
                        <outlet property="dataSource" destination="12" id="16"/>
                        <outlet property="delegate" destination="12" id="15"/>
                    </connections>
                </tableView>
                <navigationItem key="navigationItem" title="Bird Sightings" id="36"/>
            </tableViewController>
        </objects>
        <point key="canvasLocation" x="459" y="64"/>
    </scene>
    <!--Hello World Detail View Controller - Detail-->
    <scene sceneID="24">
        <objects>
            <placeholder placeholderIdentifier="IBFirstResponder" id="23" sceneMemberID="firstResponder"/>
            <viewController storyboardIdentifier="" title="Detail" id="21" customClass="HelloWorldDetailViewController" sceneMemberID="viewController">
                <view key="view" contentMode="scaleToFill" id="22">
                    <rect key="frame" x="0.0" y="64" width="320" height="416"/>
                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                    <subviews>
                        <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="bJd-7W-8nV">
                            <rect key="frame" x="0.0" y="0.0" width="320" height="445"/>
                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                            <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                            <sections>
                                <tableViewSection headerTitle="" id="Ihs-Gj-deH">
                                    <cells>
                                        <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="6ax-NG-pEn">
                                            <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
                                            <autoresizingMask key="autoresizingMask"/>
                                            <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
                                                <rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
                                                <autoresizingMask key="autoresizingMask"/>
                                                <subviews>
                                                    <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Bird Name:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="eba-dh-Ofl">
                                                        <rect key="frame" x="20" y="11" width="125" height="21"/>
                                                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                        <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
                                                        <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
                                                        <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                                    </label>
                                                    <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="PBz-NZ-g9m">
                                                        <rect key="frame" x="153" y="11" width="147" height="21"/>
                                                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                        <color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
                                                        <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                                    </label>
                                                </subviews>
                                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
                                            </view>
                                        </tableViewCell>
                                    </cells>
                                </tableViewSection>
                                <tableViewSection headerTitle="" id="YGG-h0-ybX">
                                    <cells>
                                        <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="oYs-Dm-zlN">
                                            <rect key="frame" x="0.0" y="44" width="320" height="44"/>
                                            <autoresizingMask key="autoresizingMask"/>
                                            <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
                                                <rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
                                                <autoresizingMask key="autoresizingMask"/>
                                                <subviews>
                                                    <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Location:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="mbD-Wl-CEY">
                                                        <rect key="frame" x="20" y="11" width="125" height="21"/>
                                                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                        <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
                                                        <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
                                                        <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                                    </label>
                                                    <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="A69-jC-WXb">
                                                        <rect key="frame" x="153" y="11" width="147" height="21"/>
                                                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                        <color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
                                                        <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                                    </label>
                                                </subviews>
                                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
                                            </view>
                                        </tableViewCell>
                                    </cells>
                                </tableViewSection>
                                <tableViewSection headerTitle="" id="zi6-o7-XN3">
                                    <cells>
                                        <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="gsv-CZ-0go">
                                            <rect key="frame" x="0.0" y="88" width="320" height="44"/>
                                            <autoresizingMask key="autoresizingMask"/>
                                            <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
                                                <rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
                                                <autoresizingMask key="autoresizingMask"/>
                                                <subviews>
                                                    <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Date:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="K2s-9i-tfj">
                                                        <rect key="frame" x="20" y="11" width="125" height="21"/>
                                                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                        <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
                                                        <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
                                                        <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                                    </label>
                                                    <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="PTf-Ge-Hjf">
                                                        <rect key="frame" x="153" y="11" width="147" height="21"/>
                                                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                        <color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
                                                        <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                                    </label>
                                                </subviews>
                                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
                                            </view>
                                        </tableViewCell>
                                    </cells>
                                </tableViewSection>
                            </sections>
                        </tableView>
                    </subviews>
                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
                </view>
                <navigationItem key="navigationItem" title="Sightings" id="26"/>
                <connections>
                    <outlet property="lblBirdName" destination="PBz-NZ-g9m" id="KgV-rg-2MY"/>
                    <outlet property="lblDate" destination="PTf-Ge-Hjf" id="Scy-nS-Sot"/>
                    <outlet property="lblLocation" destination="A69-jC-WXb" id="hwm-Zv-8QE"/>
                </connections>
            </viewController>
        </objects>
        <point key="canvasLocation" x="902" y="64"/>
    </scene>
</scenes>
<classes>
    <class className="HelloWorldDetailViewController" superclassName="UITableViewController">
        <source key="sourceIdentifier" type="project" relativePath="./Classes/HelloWorldDetailViewController.h"/>
        <relationships>
            <relationship kind="outlet" name="lblBirdName" candidateClass="UILabel"/>
            <relationship kind="outlet" name="lblDate" candidateClass="UILabel"/>
            <relationship kind="outlet" name="lblLocation" candidateClass="UILabel"/>
        </relationships>
    </class>
    <class className="HelloWorldMasterViewController" superclassName="UITableViewController">
        <source key="sourceIdentifier" type="project" relativePath="./Classes/HelloWorldMasterViewController.h"/>
    </class>
</classes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
    <simulatedStatusBarMetrics key="statusBar"/>
    <simulatedOrientationMetrics key="orientation"/>
    <simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>

我对objective c和Xcode完全陌生,所以我不确定我做错了什么,甚至不知道从哪里开始犯这样的错误。如果有人知道如何修复这个错误,或者有更好的(在线)资源同时学习objective c和iOS开发,我将非常感激。

Here是我的项目,如果有人想帮我看看的话。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-03-10 04:42:46

我能够找出我在教程中做错了什么。我没有拖动TableViewController并删除DetailViewController,而是将一个表拖到了详细视图顶部的控制器上。我不知道我是怎么错过的,我昨天一定很累了。

另外,任何坚持使用苹果iPhone开发教程的人,我强烈推荐iTunes上的《斯坦福iPhone开发》系列文章。我现在正在经历它,它是令人惊奇的。它解释了苹果教程从来没有做过的事情(比如什么时候在属性中使用强与弱,原子与非原子也在属性中使用)。我知道我开始理解objective c了,因为当我遇到问题时,我真的知道怎么去google了。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9626286

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档