問題描述
Xcode Storyboard 警告未提供上下文:不支持的約束屬性配置 (Xcode Storyboard Warning not providing context: Unsupported Configuration of constraint attributes)
我有這個警告,它在運行時似乎沒有引起任何問題,但它是我一段時間以來唯一的警告,我希望它消失。
單擊它會打開情節提要,但在視圖層次結構和情節提要中沒有選擇任何內容。右鍵單擊並單擊“在日誌中查看”;什麼也沒做。右鍵單擊並選擇“打開方式” 源代碼” 每次都會崩潰 XCode。右鍵單擊項目導航器中的情節提要並作為源代碼打開不會在頂部附近顯示任何警告信息,就像我遇到的其他情節提要警告一樣。
我在 SO 或 Apple 文檔中找不到有關此警告的任何信息。我可以找到其他“不支持的配置”;警告,但沒有此類消息。
知道如何找到並解決此警告的來源嗎?
謝謝
編輯 ‑ 我的特別問題是Apple的一個錯誤,處理網絡視圖,沒有辦法解決它。這是對警告的錯誤分類。如果您在嘗試像我一樣獲取它時遇到類似結果的錯誤,您可能會遇到同樣的問題:https://forums.developer.apple.com/thread/63254
但是,JOM' s answer對於修復此警告的實際預期發生非常有幫助,並且對於跟踪類似問題也非常有幫助。鑑於它如何提供解決此警告的正確方法,並且人們更有可能通過遇到警告並且沒有遇到與我相同的問題來找到此問題,我將其標記為正確。
為了更好的 SEO,警告是:“不支持的約束屬性配置。這可能會在 Xcode 5.1 之前的運行時產生意外結果"
並且人們更有可能通過遇到警告並沒有遇到與我相同的問題來找到這個問題,我會將其標記為正確。為了更好的 SEO,警告是:“不支持約束屬性的配置。這可能會在 Xcode 5.1 之前的運行時產生意外結果"
並且人們更有可能通過遇到警告並沒有遇到與我相同的問題來找到這個問題,我會將其標記為正確。為了更好的 SEO,警告是:“不支持約束屬性的配置。這可能會在 Xcode 5.1 之前的運行時產生意外結果"
參考解法
方法 1:
Open build log and check the warning by expanding the details by tapping the small box icon at right side of the warning. You should find something like this at the end:
/* com.apple.ibtool.document.warnings */ /Users/username/git/folder/project/Collection/Collection.storyboard:2f5‑sJ‑euT: warning: Unsupported configuration of constraint attributes. This may produce unexpected results at runtime before Xcode 5.1
Now open that storyboard as Source Code and search for the ID mentioned in warning. In this case it's 2f5‑sJ‑euT
. You should find something like this:
<constraint firstAttribute="centerX" secondItem="ReE‑6A‑euY"
secondAttribute="centerX" id="2f5‑sJ‑euT"/>
Now you can check what's the problem. To help that you could e.g. check where is this constraint by looking at possible reuseIdentifier
of the containing object. Makes it easier to find it, when you open the storyboard in Storyboard format.
In my case the warning was about a constraint that wasn't needed any more and I just removed it. And tested that the app still worked like it was supposed to, of course.
方法 2:
I'm just clean project and problem gone (cmd+k)
(by Jake T.、JOM、Trung Phan)