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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:55:57+00:00 2026-06-11T10:55:57+00:00

I using tip from this ask stackoverflow.com/questions/12413460 It’s work. My problem is the image

  • 0

I using tip from this ask stackoverflow.com/questions/12413460
It’s work. My problem is the image not refresh while application not restart or not rebuilding.
I use method for create screenshot. I what have same functional: use touch scree, and screenshot will save into documents directory. User touch second, second screenshot save. And so. But in my app every time only first touch screenshot created, as it cached or buffer ed.

-(UIImage *) screenshotWithStartNode:(CCNode*)startNode
{
    [CCDirector sharedDirector].nextDeltaTimeZero = YES;

    CGSize winSize = [CCDirector sharedDirector].winSize;
    CCRenderTexture* rtx = 
    [CCRenderTexture renderTextureWithWidth:winSize.width 
                                 height:winSize.height];
    [rtx begin];
    [startNode visit];
    [rtx end];

    return [rtx getUIImage];
}

I call it when user touch screen (for example)

- (void)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    CCNode *n = [[[CCDirector sharedDirector] runningScene].children objectAtIndex:0];
    UIImage *img = [self screenshotWithStartNode:n];//this image always same by one, same when user touch screen first time
    CCSprite *spriteTemp = [CCSprite spriteWithCGImage:img.CGImage key:@"image"];
    [self addChild:spriteTemp];
}

On the screen items have different position in time.
First touch on the screen get right image.But all other touch create screenshots as first image and dose not change.

I think maybe it’s buffer CCRenderTexture? or image cache? What i will do?

i try [img release] and try CGImageRelease(img.CGImage) after touch, but it crash app.

  • 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-11T10:55:58+00:00Added an answer on June 11, 2026 at 10:55 am

    You’re right, the previous information is being cached. Try a

    [[CCTextureCache sharedTextureCache] removeTextureForKey:@"image"];
    

    before you try to overwrite.

    Or use difference key names if you need more than one image at once.

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

Sidebar

Related Questions

Picking up a tip from someone else on this site, I've been using logical
Using the tip provided by José Adan at http://social.msdn.microsoft.com/Forums/en-US/vstscode/thread/f6dec8c4-9752-4a9b-82fe-0822808fd386/ I was able to get
I am using this query: SELECT district, id FROM adverts ls GROUP BY district,
The title attribute didn't shows. If you have a tip using another attribute type,
One useful tip I've been using for XCode is adding breakpoints on exceptions .
Using a CSS image sprite, I'm creating an 'interactive' image where hovering over certain
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using CI for the first time and i'm smashing my head with this seemingly
What I'm doing I'm pulling an image from the database and sending it to
I wrote this yesterday, in a class Foo inheriting from Bar: public override void

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.