ios - NSImage to NSData, then to UIImage -
I am creating a plast with my OSX app that contains some images, as a template for the iOS app. I am using this plist file:
[NSKeyedArchiver archivedDataWithRootObject: self.someImage] But here I am going to file UIImage Can not convert it to NSImage (as it is only for OSX). I get this error:
* Cancel the app due to non-exception 'NSInvalidUnarchiveOperationException', reason: '* - [ NSKeyedUnarchiver decodeObjectForKey:]: Can not decode the object of class (NSImage) '/ p> Please suggest a way to overwrite me.
OS X: for nked archer Instead of using a NSImage to the NSData , NSImage method: NSData * ImageData = [Self estimate; TIFF rendering]; // file data to save the file iOS:
Read image data from file, then convert it to UIImage using UIImage feature maker Do: NSData * ImageData = ...; // UIImage file from the load image file * image = [UIImage imageWithData: imageData];
Comments
Post a Comment