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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:56:15+00:00 2026-06-04T13:56:15+00:00

Is it possible to pass an objective c class (or maybe the notation is

  • 0

Is it possible to pass an objective c class (or maybe the notation is interface?) as message argument? Something like this:

-(void) f:(Class) c
{
  [c message];
}

To be more specific I want to call the following line:

[[CCDirector sharedDirector] replaceScene:[CCTransitionCrossFade transitionWithDuration:0.5f scene:[SceneDefence scene]]];

But I want SceneDefence to be a variable. I want to be able to call either SceneDefence or SceneAttack. The next scene will be stored in an instance variable in the init method, to later be used when the scene shall be changed.

  • 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-04T13:56:16+00:00Added an answer on June 4, 2026 at 1:56 pm

    Yes you had it correct, you just need to call the class method class.

    -(void) f:(Class) c
    {
        [c message]; //message will need to be a class method
    }
    
    ...
       [myclass f:[SceneDefence class]];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to pass the coloumn name also like a variable.Please edit this
In Objective-C, it is possible to pass a class as a parameter to a
Is it possible to pass a input value of prompt box like this? <script
(I probably didn't phrase that very well!) I'd like to pass a Class object
I'm wondering if is possible pass types by argument in Java. Let me explain
Is it possible to pass an argument to the listener when a button is
I have a C++ helper class that I use with objective-C. I would like
Is it possible to pass a an Objective-C pointer function to a C function?
Is it possible to pass parameters, or access external parameters to an anonymous class?
Possible Duplicate: pass inputbox value as a querystring to URL <input name=KeywordBox class=BasicSearchInputBox type=text

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.