如何解决编译错误:" AttValue:"或者'预期"在xcode中

时间:2017-07-28 02:29:48

标签: swift

我已经重命名了我的项目,在完成所有工作并解决所有错误后,我在" TakeEditCell.xib "

中面临以下错误
 Line 15: AttValue: " or ' expected
 Line 15: attributes construct error
 Line 15: Couldn't find end of Start Tag tableViewCell

以下是代码:

<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
    <device id="ipad9_7" orientation="portrait">
        <adaptation id="fullscreen"/>
    </device>
    <dependencies>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
        <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
        <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
    </dependencies>
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
        <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="wS8-vg-jwz" customClass="TakeEditCell" customModule=“ProjXXX” customModuleProvider="target">
            <rect key="frame" x="0.0" y="0.0" width="375" height="360"/>
            <autoresizingMask key="autoresizingMask"/>
            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="wS8-vg-jwz" id="Utt-1e-lcR">
                <rect key="frame" x="0.0" y="0.0" width="375" height="359.5"/>
                <autoresizingMask key="autoresizingMask"/>
                <subviews>
                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="BmU-14-LCQ">
                        <rect key="frame" x="16" y="24" width="150" height="144"/>
                    </imageView>
                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="qlG-3t-cI6">
                        <rect key="frame" x="209" y="24" width="150" height="144"/>
                    </imageView>
                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="gho-rc-34o">
                        <rect key="frame" x="16" y="184" width="150" height="143.5"/>
                    </imageView>
                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="bHt-0J-ApW">
                        <rect key="frame" x="209" y="184" width="150" height="143.5"/>
                    </imageView>
                </subviews>
                <constraints>
                    <constraint firstItem="bHt-0J-ApW" firstAttribute="width" secondItem="BmU-14-LCQ" secondAttribute="width" id="3aA-8U-9wy"/>
                    <constraint firstItem="BmU-14-LCQ" firstAttribute="height" secondItem="Utt-1e-lcR" secondAttribute="height" multiplier="4:10" id="6OS-Y2-kG2"/>
                    <constraint firstItem="BmU-14-LCQ" firstAttribute="top" secondItem="Utt-1e-lcR" secondAttribute="topMargin" constant="16" id="BWB-xz-0p1"/>
                    <constraint firstItem="gho-rc-34o" firstAttribute="top" secondItem="BmU-14-LCQ" secondAttribute="bottom" constant="16" id="Ca2-eW-pZc"/>
                    <constraint firstItem="bHt-0J-ApW" firstAttribute="height" secondItem="BmU-14-LCQ" secondAttribute="height" id="HHb-gN-yip"/>
                    <constraint firstItem="qlG-3t-cI6" firstAttribute="width" secondItem="BmU-14-LCQ" secondAttribute="width" id="I9l-S5-Ara"/>
                    <constraint firstItem="gho-rc-34o" firstAttribute="height" secondItem="BmU-14-LCQ" secondAttribute="height" id="NR0-h1-OdF"/>
                    <constraint firstItem="bHt-0J-ApW" firstAttribute="top" secondItem="qlG-3t-cI6" secondAttribute="bottom" constant="16" id="Sjs-Eo-kXO"/>
                    <constraint firstItem="qlG-3t-cI6" firstAttribute="top" secondItem="Utt-1e-lcR" secondAttribute="topMargin" constant="16" id="T6v-sn-eyA"/>
                    <constraint firstItem="BmU-14-LCQ" firstAttribute="leading" secondItem="Utt-1e-lcR" secondAttribute="leadingMargin" constant="8" id="aDx-cC-L9V"/>
                    <constraint firstAttribute="trailingMargin" secondItem="bHt-0J-ApW" secondAttribute="trailing" constant="8" id="htv-Ey-z5r"/>
                    <constraint firstItem="gho-rc-34o" firstAttribute="width" secondItem="BmU-14-LCQ" secondAttribute="width" id="lfP-06-sJF"/>
                    <constraint firstItem="qlG-3t-cI6" firstAttribute="height" secondItem="BmU-14-LCQ" secondAttribute="height" id="qla-mw-D06"/>
                    <constraint firstAttribute="trailingMargin" secondItem="qlG-3t-cI6" secondAttribute="trailing" constant="8" id="t5U-t8-dw2"/>
                    <constraint firstItem="gho-rc-34o" firstAttribute="leading" secondItem="Utt-1e-lcR" secondAttribute="leadingMargin" constant="8" id="uFq-CZ-EZ1"/>
                    <constraint firstItem="BmU-14-LCQ" firstAttribute="width" secondItem="Utt-1e-lcR" secondAttribute="width" multiplier="4:10" id="zXA-DD-WpX"/>
                </constraints>
            </tableViewCellContentView>
            <connections>
                <outlet property="imageView1" destination="BmU-14-LCQ" id="3TE-4D-xyQ"/>
                <outlet property="imageView2" destination="qlG-3t-cI6" id="HUi-SF-bI6"/>
                <outlet property="imageView3" destination="gho-rc-34o" id="x98-iX-GIR"/>
                <outlet property="imageView4" destination="bHt-0J-ApW" id="YWl-Rb-vJT"/>
            </connections>
            <point key="canvasLocation" x="-73.5" y="4"/>
        </tableViewCell>
    </objects>
</document>

似乎 tableViewCell 已正确关闭

我甚至试图替换&#34; TakeEditCell .xib&#34;文件包含来自备份 原始 ,但它没有帮助,我也阅读了其他帖子,但没有一个是有帮助的。< / p>

任何建议都将受到赞赏。

1 个答案:

答案 0 :(得分:1)

您的问题是第15行的.xib文件中有智能引号

变化:

<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="wS8-vg-jwz" customClass="TakeEditCell" customModule=“ProjXXX” customModuleProvider="target">

为:

<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="wS8-vg-jwz" customClass="TakeEditCell" customModule="ProjXXX" customModuleProvider="target">

当您使用TextEdit或其他非IDE应用程序手动编辑.xib文件时,可能会发生这种情况。

当编辑.xib文件在Xcode的Interface Builder功能之外的内容时,您可以通过单击Xco​​de窗口左侧的.xib图标(文件和文件夹所在的位置)在Xcode中“作为源代码打开”,同时按住控制键以显示上下文菜单。