Post

Replies

Boosts

Views

Activity

Reply to Thread 1: EXC_BAD_ACCESS (code=2, address=0x16cd2fff8)
I can view the result's search in any case (also with the json file with 40.000 record). No problem with the array or the json file is correct. After i fill the list, i've the error simply changing the view. I haven't used this code: List { ForEach(listItems, id: \.self) { (item) in Text(item) }.onDelete { (indexSet) in self.listItems.remove(atOffsets: indexSet) } } I'll try tu use this code in bold. thank you
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’21
Reply to Thread 1: EXC_BAD_ACCESS (code=2, address=0x16cd2fff8)
with this code I fill the list struct RisultatiRicercaNominativo: View {     @EnvironmentObject var ricerca: Ricerca     let elettore: Elettore     var ricercaPrecisa :Array = [String]()     var ricercaarrey = [ArrayAny]()     var body: some View {         VStack {         navRitorno()                 .background(Color.blue) List {                 ForEach(elettori) { item in                         // CASO NOME PIENO E COGNOME PIENO                         if ricerca.nome != "" && ricerca.cognome != ""  {                             if String(item.cognome).contains(ricerca.cognome.uppercased())  && String(item.nome).contains(ricerca.nome.uppercased()){                                 ElettoreSingoloView(elettore: item)                                     .padding(.horizontal, 20)                             } else {                                 EmptyView()                             }                         } //End if                         // CASO NOME VUOTO E COGNOME PIENO                         if ricerca.nome == "" && ricerca.cognome != ""  {                             if String(item.cognome).contains(ricerca.cognome.uppercased())  {                                 ElettoreSingoloView(elettore: item)                                     .padding(.horizontal, 20)                             } else {                                 EmptyView()                             }                         } //End if                     } //END LOOP                 } //LIST             .listStyle(InsetGroupedListStyle()) I can see the list filled in any case. With this button I return to the content view:             Button(action: {                 ricerca.cognome = ""                  ricerca.nome = ""                 ricerca.sezione = ""                 ricerca.indirizzo = "" ricerca.isResult = false              //   }             }, label: {                 Image(systemName: "chevron.left")                     .font(.title)                     .foregroundColor(.white)             }) If the json file contains 1000 record all is ok :(
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’21