显示来自NSCFDictionary的图像(osx环境)

时间:2014-02-10 16:54:54

标签: objective-c

需要帮助退出头痛...我无法显示从ID3tag检索的图像。

我的代码

         MP3InfoDictionary = (__bridge NSDictionary*)dictRef;
         if (MP3InfoDictionary != NULL) {
          NSLog(@"MP3InfoDictionary APIC %@",[MP3InfoDictionary objectForKey:@"APIC"]);

...控制台中的此输出

enter image description here

问题:如何将字典中的图像显示到NSImage我必须遵循哪一步?

我确实尝试过所有事情都没有成功。

1 个答案:

答案 0 :(得分:1)

NSDictionary* apic = mp3InfoDictionary[@"APIC"];  // Variables should begin with lower case
NSDictionary* nameless = apic[@""];
NSData* imageData = nameless[@"data"];
<Convert imageData to image using the method of your choice>