class InventoryModel: ObservableObject {
@Published var fileData = [inventoryEntry]()
var fileData2 = [inventoryEntry]() // for debug viewing fileData
var fileData3 = [inventoryEntry]() // for debug viewing fileData
.....
}
struct inventoryEntry{
var id: UUID = UUID()
var name: String = ""
var catagory: String = ""
var subcatagory: String = ""
var location: String = ""
}
inventoryModel.fileData.sort{$0.name < $1.name}
before sort the array has 64 entries and it is also stored in fileData2 viewable at break point
after sort the array has 127 entries and I store hit in fileData3 viewable at break point
What happened here. I did not expect sorting the array to add copied entries
I consider this a bug. bug?
@Published var fileData = [inventoryEntry]()
var fileData2 = [inventoryEntry]() // for debug viewing fileData
var fileData3 = [inventoryEntry]() // for debug viewing fileData
.....
}
struct inventoryEntry{
var id: UUID = UUID()
var name: String = ""
var catagory: String = ""
var subcatagory: String = ""
var location: String = ""
}
inventoryModel.fileData.sort{$0.name < $1.name}
before sort the array has 64 entries and it is also stored in fileData2 viewable at break point
after sort the array has 127 entries and I store hit in fileData3 viewable at break point
What happened here. I did not expect sorting the array to add copied entries
I consider this a bug. bug?