Save image file to temp directory
问题 I have an image file named "Image.png", and it is saved in my main bundle (right beside the ViewController.swift file in the Project Navigator hierarchy). I want to save a copy of this image to the temporary directory. I've never done it before, what code could I use please? 回答1: Something like this should do the trick. I'm assuming you wanted the answer in Swift. /** * Copy a resource from the bundle to the temp directory. * Returns either NSURL of location in temp directory, or nil upon