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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T06:21:52+00:00 2026-05-19T06:21:52+00:00

This question is semi-similar to the one asked here But the difference is that

  • 0

This question is semi-similar to the one asked here

But the difference is that I’m using cocos2d.
I have a method named screenshot in my AppDelegate. It’s obviously used to take a screenshot. I want to call this method in another class, but simply doing [self screenshot]; isn’t working out because I get the warning ‘GameOver’ my not respond to ‘-screenshot’.

All I want is for the screenshot method to be called in GameOver.

Thanks!

  • 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-05-19T06:21:53+00:00Added an answer on May 19, 2026 at 6:21 am

    You can’t call a method that does not exists – it will generate a runtime error.

    If you want to call a method of AppDelegate from GameOver you should have a pointer to AppDelegate object if the method is not static:

    [appDelegatePointer screenshot];
    

    If the method is static

    [AppDelegate screenshot];
    

    I suppose you have only one object AppDelegate and you can make a static method

    +(AppDelegate) sharedDelegate;
    

    of class AppDelegate that will return your object singleton. And so you will be able to call screenshot method from GameOver object or from any other place like this:

    [[AppDelegate sharedDelegate] screenshot];
    

    Such thing is done in CCDirector, CCTextureCache, SimpleAudioEngine, … classes in Cocos2D

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

Sidebar

Related Questions

This question is similar to LINQ group one type of item but handled in
I asked a similar question yesterday that was specific to a technology, but now
This question comes on the heels of the question asked here . The email
This might be a dumb question, but considering the following semi-pseudo code. How do
first time poster - semi-newb to Rails. Here is my question. Suppose you have
I would guess this is a semi-common question but I can't find it in
I'm unsure if SO is the best place for this question, but here goes:
This question was very helpful, however I have a list control in my report,
I appreciate this is an incredibly noob question, but having Googled multiple combinations of
This is a semi-related question to question to the following question I just raised:

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.