Friday, August 26, 2011

From NSData to CFDataRef


NSData *imageData = UIImagePNGRepresentation(originalImage);
CFDataRef cfdata = CFDataCreate(NULL, [imageData bytes], [imageData length]);

2 comments:

  1. Thanks!
    i'm new in iphone and i want to add this image in dictionary after converting image in NSData
    [dict setValue:imgDataRef forKey:@"Image"];
    after that this dict add to array as object and then i write that array in plist.
    so please can you help me?

    ReplyDelete