How to archive and unarchive images in iphone
I am coding an iPhone application where images are transferred from one iPhone to another using Bluetooth. How do I archive an image and send it to another iPhone, then un-archive the image back? Archiving the image directly using NSKeyedarchiver开发者_StackOverflow中文版 doesn't work.
You can turn UIImage objects into NSData representations using the Image Manipulation function UIImageJPEGRepresentation
or UIImagePNGRepresentation
.
You can turn the NSData representation into a UIImage using the UIImage convenience method imageWithData: or initializer initWithData:.
精彩评论