I'm currently working on a Swift application that interacts with the Shopify API through their Mobile Buy SDK. I'm having issues saving the cart to the device. Everything else works fine, but when I use the following code to save the cart to the device:
func saveCart() {
NSUserDefaults.standardUserDefaults().setObject(cart, forKey: "cart")
println("cart saved")
}
I receive the following error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Attempt to insert non-property list object <BUYCart: 0x7fb5e30512f0> for key cart'