5
我已經嘗試合併我的Git
存儲庫上的兩個分支,並在我的Storyboard
文件中發生了一些衝突。下面是衝突行:Git衝突導致故事板問題
<resources>
<image name="IconAddToCart" width="30" height="34"/>
<<<<<<< HEAD
<image name="IconAddToCart" width="30" height="34"/>
=======
<image name="IconCartBig" width="149" height="111"/>
>>>>>>> 0133fd1364e6e590034bba1c0e32273bcf22a3d2
<image name="IconCheckmark" width="13" height="13"/>
<image name="LoginBackground" width="320" height="568"/>
<image name="LoginBackground" width="320" height="568"/>
<image name="LoginLogo" width="257" height="73"/>
<image name="ScanButton" width="178" height="61"/>
</resources>
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
<inferredMetricsTieBreakers>
<segue reference="rCk-dF-YMq"/>
<segue reference="SKx-bH-AaC"/>
<segue reference="ofx-gD-lnj"/>
<segue reference="Eo1-ee-RYE"/>
<segue reference="mb5-Kc-qz1"/>
<segue reference="qYH-kM-beE"/>
<segue reference="QOW-kb-Y6W"/>
<<<<<<< HEAD
<segue reference="vKq-do-lYa"/>
=======
<segue reference="CgX-ql-qnP"/>
<segue reference="gwc-Z9-zHd"/>
>>>>>>> 0133fd1364e6e590034bba1c0e32273bcf22a3d2
</inferredMetricsTieBreakers>
我試着通過刪除被複制的代碼行,並刪除衝突標記固定的衝突,這是文件的一部分,現在的樣子:
<resources>
<image name="IconAddToCart" width="30" height="34"/>
<image name="IconCartBig" width="149" height="111"/>
<image name="IconCheckmark" width="13" height="13"/>
<image name="LoginBackground" width="320" height="568"/>
<image name="LoginBackground" width="320" height="568"/>
<image name="LoginLogo" width="257" height="73"/>
<image name="ScanButton" width="178" height="61"/>
</resources>
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
<inferredMetricsTieBreakers>
<segue reference="rCk-dF-YMq"/>
<segue reference="SKx-bH-AaC"/>
<segue reference="ofx-gD-lnj"/>
<segue reference="Eo1-ee-RYE"/>
<segue reference="mb5-Kc-qz1"/>
<segue reference="qYH-kM-beE"/>
<segue reference="QOW-kb-Y6W"/>
<segue reference="vKq-do-lYa"/>
<segue reference="CgX-ql-qnP"/>
<segue reference="gwc-Z9-zHd"/>
</inferredMetricsTieBreakers>
即使在那之後,編譯器仍然給了我以下錯誤:The document "Main.storyboard"could not be opened. The operation couldn't be completed. (com.apple.InterfaceBuilder error -1.)
是一個什麼錯誤的原因,如果我已經刪除這些行?
看看http://stackoverflow.com/questions/12725116/the-document-mainstoryboard-storyboard-could-not-be-opened – Chiron
除了最後一個答案... XIB的文件不能是由兩個人同時編輯,所以當你嘗試合併你的文件時會說不能打開。合併XML文件(這就是XIB文件的末尾)是一件很痛苦的事,你知道是什麼。所以,我的建議是,你要協調誰來接觸每個XIB文件。 –
此行重複:' '。 Xcode 5可以修復這個問題(並告訴你這可能是因爲SCM合併而發生的),但是也許你使用了舊版本的Xcode,這可能無法解決這個問題。 –
Vili