Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7940153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:18:18+00:00 2026-06-03T23:18:18+00:00

i converted NSData of image to CGImage as below but i am getting memory

  • 0

i converted NSData of image to CGImage as below but i am getting memory leaks there but any one tell me how to convert that with out getting leaks:

CFDataRef imgData;
CGDataProviderRef imgDataProvider;
CGImageRef image1;
imgData = (CFDataRef)[array objectAtIndex:i];
    imgDataProvider = CGDataProviderCreateWithCFData (imgData);
    image1 = CGImageCreateWithPNGDataProvider(imgDataProvider, NULL, true, kCGRenderingIntentDefault);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T23:18:19+00:00Added an answer on June 3, 2026 at 11:18 pm

    This should work:

    CFDataRef imgData;
    CGDataProviderRef imgDataProvider;
    CGImageRef image1;
    imgData = (CFDataRef)[array objectAtIndex:i];
    imgDataProvider = CGDataProviderCreateWithCFData (imgData);
    CFRelease(imgData);
    image1 = CGImageCreateWithPNGDataProvider(imgDataProvider, NULL, true, kCGRenderingIntentDefault);
    CGDataProviderRelease(imgDataProvider);
    

    Don’t forget to use CGImageRelease(image1); after you are done with it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iphone app that converts a image into NSData & then converts
Possible Duplicate: NSData to UIImage How do I convert a NSData value to UIImage?
I have UTF-8 encoded NSData from windows server and I want to convert it
i have a NSData object. I want to convert it to a string, pass
I have a NSData object, i need to convert it a NSDictionary object. NSData
I converted an old cvs repository into mercurial via hg convert . Everything seemed
Using foundation and cocoa frameworks on Mac, I am trying to convert an NSData
i have a image to post web service and i need to convert UIImage
NSData *imageData = UIImagePNGRepresentation(your_image_here); After that i transferred it to another iPhone using bluetooth.
I am trying to convert an image into grayscale in the following way: #define

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.