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

  • Home
  • SEARCH
  • 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 3605206
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:05:41+00:00 2026-05-18T21:05:41+00:00

I’m working on an app where I’d like to use cocos2d in the app’s

  • 0

I’m working on an app where I’d like to use cocos2d in the app’s home screen, but not elsewhere (in other places standard UIKit stuff is more appropriate). So, I’ve got my EAGLView set up as the root view in a UINavigationController, and when the user taps in the right place I push a new view controller onto the nav controller.

That’s working great, so far. The cocos2d/chipmunk stuff in the home view is working great, pushing a new view controller works as expected.

But when I pop back to the home view, nothing’s there. All I see is the window background and the navigation bar.

I set a breakpoint in the root view controller’s -viewDidAppear: to see what’s going on after the pop, and so far everything appears normal (or at least the same as it was before the push).

The push is just a bog-standard nav controller push. I’m not seeing any kind of memory warnings. Anyone have thoughts on what’s going on?

There’s a simple demo project that shows this behavior at http://cl.ly/1Q050s0h2k47032K1Y1N

This is based on the cocos2d+chipmunk project template. Tap on Grossini and a new view controller is pushed onto the stack. Tap the back button, and Grossini is gone.

And just to make it interesting, this problem only exists on an iOS device (I’m running 4.1), not in the simulator.

  • 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-18T21:05:42+00:00Added an answer on May 18, 2026 at 9:05 pm

    I have solved your problem.
    You have to follow some steps in your code.

    In RootViewController nib file change the view Identity from HomeView to UIView.

    Create a Home View Object in the RootViewController Class

    @interface RootViewController : UIViewController {
        HomeView *homeViewObj;
    }
    

    in RootViewController.m file in ViewDidLoad method add this code

    homeViewObj = [[HomeView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    [self.view addSubview:homeViewObj];
    

    and replace this code in your ViewDidLoad method at required place.

    CCDirector *director = [CCDirector sharedDirector];
    
        // attach the openglView to the director
        [director setOpenGLView:(EAGLView *)homeViewObj];
    
        [director setDeviceOrientation:kCCDeviceOrientationPortrait];
        [director setAnimationInterval:1.0/60];
        [director setDisplayFPS:YES];
    

    Then the problem will be solved, All the best.

    Regards,

    Satya

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I am trying to render a haml file in a javascript response like so:

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.