So I am trying to build an e-commerce app for a startup. I have made almost everything work except a NavigationLink that goes to a page with the product details.
The way I have it coded now actually works in debug, but not for the release version.
This is the general hierarchy I have for the pages that go to the product details:
- Shop Page
- Tops
- View that lists top previews with NavigationLinks to product details
- Tops
To create the list of previews, I essentially do this (this is a simplification as I display two columns)
ForEach(products, id: \.self) { item in
ShopPreview(product: item)
}
The products is a @State and list of products that is populated when the view appears. item is a struct : Model that was generated by AWS.
The ShopPreview is a struct : View that contains product using a let and the NavigationLink to destination ProductView(product: product).
I keep getting a EXC_BAD_ACCESS crash at the NavigationLink line, and I'm not sure what I'm doing wrong that is causing this error.
I have attached the crash log from TestFlight. Any insight on this is very much appreciated.