SwiftUI CoreData relationship binding Bug

I developing simple app to calculate personal money income and consumption.

I use CORE DATA to save my model.

The models consists of this

CDCatalogWallet
var name: String
var ref: String

CDCatalogStateIncome
var name: String
var ref: String

CDDocumentIncome
var ref: String
var wallet: CDCatalogWallet (relationship has one)
var states_: CDDocumentIncomeState (relationship has many)

CDDocumentIncomeState
var cdCatalogStateIncome: CDCatalogStateIncome (relationship has one)
var document: CDDocumentIncome (relationship has one)

CDDocumentIncome hasMany -> CDDocumentIncomeState hasOne -> CDCatalogStateIncome The bug shows when we pushing CDDocumentIncomeState view

The model is simple. The CDDocumentIncome has relationship property cdCatalogStateIncome (relationship many).

We open view with CDDocumentIncome and want to add new cdCatalogStateIncome to CDDocumentIncome

Then we open view with new cdCatalogStateIncome. On this screen cdCatalogStateIncome has a relationship to CDDocumentIncomeState.

But view does not opened. Console constantly print messages

DocumentIncomeStateDetailView: @self changed.
DocumentIncomeStateDetailView: @self changed.
DocumentIncomeStateDetailView: @self changed.
DocumentIncomeStateDetailView: @self changed.

Also memory increase constantly and very fast.

I understand that the view renders constantly. But I cannot figure out what cause a bug.

The full code is available on github

Github Project

Answered by sapgv in 781310022

I update Xcode from 14.2 to 15.2 and problem disappeared.

Accepted Answer

I update Xcode from 14.2 to 15.2 and problem disappeared.

SwiftUI CoreData relationship binding Bug
 
 
Q