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 9214353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:57:25+00:00 2026-06-18T01:57:25+00:00

Im trying to render a view to an image, Ive been following this example:

  • 0

Im trying to render a view to an image,
Ive been following this example:
Render a full UIImageView to a bitmap image

as well as others.

My problem is that when I get to the line

[view.layer renderInContext:UIGraphicsGetCurrentContext()];

I get a warning stating that “-instance method ‘-renderInContex:’ not found

Every example I see that renders a view to an image uses this line. So why is my example not working?

Heres the full code:

-(void)RenderViewToImage:(UIView *)view
{    
     UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, 0.0);
     [view.layer renderInContext:UIGraphicsGetCurrentContext()];
     UIImage *bitmapImage = UIGraphicsGetImageFromCurrentImageContext();
     UIGraphicsEndImageContext();

     NSArray *documentsPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,    NSUserDomainMask, YES);
     NSString *documentsDir = [documentsPaths objectAtIndex:0];
     [UIImagePNGRepresentation(bitmapImage) writeToFile:[documentsDir stringByAppendingString:@"num1.png"] atomically:YES];   

}

  • 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-18T01:57:27+00:00Added an answer on June 18, 2026 at 1:57 am

    Make sure you link against the QuartzCore framework.

    Make sure you import the following header:

    #import <QuartzCore/QuartzCore.h>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background I'm receiving the following error when trying to render a partial view in
ive been trying to render a picture from carrierwave. i believe it is uploaded
inside show.js.erb $('#viewport').html(<%= escape_javascript(render('show')) %>); I am trying to render the show view into
I'm trying to render an in-memory (but not in hierarchy, yet) UIViewController's view into
trying to render the contents of an IFrame in an Asp.Net Application. This is
Im trying to render emails on my site. The problem is that these emails
I've been stuck for hours trying to render a Core Animation layer tree into
I've been trying to use backbonejs and jqm together. I can render the main
I'm trying to get my head around using QuartzCore to render semi-complex text/gradient/image UITableViewCell
why is the image I'm trying to render in a custom UIView not being

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.