Xcode Storyboard 警告未提供上下文:不支持的約束屬性配置 (Xcode Storyboard Warning not providing context: Unsupported Configuration of constraint attributes)


問題描述

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.JOMTrung Phan)

參考文件

  1. Xcode Storyboard Warning not providing context: Unsupported Configuration of constraint attributes (CC BY‑SA 2.5/3.0/4.0)

#storyboard #iOS #XCode #compiler-warnings






相關問題

如何在 XAML 中為資源設置動畫? (How to animate a resource in XAML?)

使用情節提要設置 GLKView 的初始大小 (Set an initial size of GLKView with storyboard)

在情節提要中為“平鋪”創建更大的反面視圖 (Creating a larger flip-side view for 'tile' in storyboard)

XNA/XAML 鼠標懸停時動畫邊框顏色 (XNA/XAML Animate border color on mouseover)

帶有自定義按鈕的故事板 (Storyboard with Custom Buttons)

添加子視圖控制器並更改其標籤 (Adding a child view controller and changing its label)

Thêm các nút vào Ô Chế độ xem Bảng tùy chỉnh trong Lớp Bảng Xem tùy chỉnh (Adding buttons to custom Table View Cell under custom TableView Class)

ios在表格視圖單元格中視覺調整圖像大小 (ios visually resize image in a table view cell)

如何解決“在類型'ControlTemplate'中找不到可附加屬性'觸發器'”? (How to resolve "The attachable property 'Triggers' was not found in type 'ControlTemplate'"?)

Xcode 7.3、Swift 2.2 故事板極慢 (Xcode 7.3, Swift 2.2 Storyboards Extremely Slow)

Xcode Storyboard 警告未提供上下文:不支持的約束屬性配置 (Xcode Storyboard Warning not providing context: Unsupported Configuration of constraint attributes)

推送視圖控制器在 Swift 中不起作用 (Push view controller not working in Swift)







留言討論