Error when trying to save image in NSUserDefaults using Swift
问题 When i try to save an image in NSUserDefaults, the app crashed with this error. Why? Is it possible to save an image with NSUserDefaults? If not, then how do I save the image? Image... Code... var image1:UIImage = image1 var save1: NSUserDefaults = NSUserDefaults.standardUserDefaults() save1.setObject(Info.Image1, forKey: "Image1") save1.synchronize() Log error... libc++abi.dylib: terminating with uncaught exception of type NSException (lldb) 回答1: NSUserDefaults isn't just a big truck you can