我有一个NSData
对象,据说包含 TIFF 格式的图像数据。这是一个输出示例(在左上角的框中)。
但是,当我NSLog
出来时,我得到以下信息:
<NSImage 0x10013f620 Size={200, 200} Reps=(
"NSBitmapImageRep 0x1001220d0 Size={200, 200} ColorSpace=(not yet loaded) BPS=8 BPP=(not yet loaded) Pixels=200x200 Alpha=NO Planar=NO Format=(not yet loaded) CurrentBacking=nil (faulting) CGImageSource=0x100150070"
)>
这让我觉得它实际上可能是一个 BitmapImage。
无论如何,当我执行以下操作时:
NSData *artworkData;
NSImage *image;
artworkData = [self.currentTrack artwork]; // actually sets memory, like expected
image = [[NSImage alloc] initWithData:artworkData]; // causes the error
我收到此错误:
2012-12-03 02:39:56.263 test[92556:303] -[NSImage length]: unrecognized selector sent to instance 0x10064ec90
2012-12-03 02:39:56.264 test[92556:303] -[NSImage length]: unrecognized selector sent to instance 0x10064ec90
有任何想法吗?这已经困扰了我很长一段时间了。
谢谢!