开发者

What format is person's ImageData(CFDataRef) in AddressBook?(Jpeg or PNG)?Or how to determine?

From AddressBook's API ABPersonCopyImageData I can get a CFDateRef which is toll-free bridge to NSData. And I want to write this data开发者_StackOverflow社区 to file, but what file extension should I use ? .jpeg or .png?

The documentation doesn't mention what the data is.Is there any way to know?


NSData  *imgData = (__bridge NSData *)ABPersonCopyImageData(person);
        UIImage *img = [UIImage imageWithData:imgData];
        if (!img) {
            img = [UIImage imageNamed:@"noImage.png"];
        }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜