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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:19:21+00:00 2026-06-17T07:19:21+00:00

I have a normal storyboard in an iOS app. It contains ViewController A with

  • 0

I have a normal storyboard in an iOS app. It contains ViewController “A” with a button. When that button is tapped, it loads a Cocos2D view – to do this I simply copied the code from the default AppDelegate that you get when you create a new Cocos2D project:

window_ = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];


CCGLView *glView = [CCGLView viewWithFrame:[window_ bounds]
                               pixelFormat:kEAGLColorFormatRGB565   
                               depthFormat:0    
                        preserveBackbuffer:NO
                                sharegroup:nil
                             multiSampling:NO
                           numberOfSamples:0];

[glView setMultipleTouchEnabled:YES];

director_ = (CCDirectorIOS*) [CCDirector sharedDirector];

director_.wantsFullScreenLayout = YES;

[director_ setDisplayStats:YES];


[director_ setAnimationInterval:1.0/60];

[director_ setView:glView];

[director_ setDelegate:self];

[director_ setProjection:kCCDirectorProjection2D];

if( ! [director_ enableRetinaDisplay:YES] )
    CCLOG(@"Retina Display Not supported");

[CCTexture2D setDefaultAlphaPixelFormat:kCCTexture2DPixelFormat_RGBA8888];

CCFileUtils *sharedFileUtils = [CCFileUtils sharedFileUtils];
[sharedFileUtils setEnableFallbackSuffixes:NO];             // Default: NO. No fallback suffixes are going to be used
[sharedFileUtils setiPhoneRetinaDisplaySuffix:@"-hd"];      // Default on iPhone RetinaDisplay is "-hd"
[sharedFileUtils setiPadSuffix:@"-ipad"];                   // Default on iPad is "ipad"
[sharedFileUtils setiPadRetinaDisplaySuffix:@"-ipadhd"];    // Default on iPad RetinaDisplay is "-ipadhd"


[CCTexture2D PVRImagesHavePremultipliedAlpha:YES];


[director_ pushScene: [HelloWorldLayer scene]];


navController_ = [[UINavigationController alloc] initWithRootViewController:director_];
navController_.navigationBarHidden = YES;

[window_ setRootViewController:navController_];


[window_ makeKeyAndVisible];

That’s all very well, and it works like a charm when loading the “HelloWorldLayer”.
However I cannot seem to removed this “HelloWorldLayer” and make the app go back to using storyboards.
At the moment I have a function in my “HelloWorldLayer” that does the following:

[[CCDirector sharedDirector].openGLView removeFromSuperview];
[[CCDirector sharedDirector] removeFromParentViewController];
[self removeFromParentAndCleanup:TRUE];

This works well in literally removing the Cocos2D from the project, but I cannot tap anything in ViewController “A” after I have done the above: buttons do not respond to touches – it’s as if the app has frozen.

Help would be greatly appreciated!

PS: Here is a link to a file that has the problem: http://www.mediafire.com/?ipnlpinl5i0lw4a

  • 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-17T07:19:22+00:00Added an answer on June 17, 2026 at 7:19 am

    OK, I figured it out: the window_ that is allocated in the first line of code is still covering ViewController A. I have to call [window_ release] from ViewController A once the HelloWorldLayer has visually disappeared to get it out of the way.

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

Sidebar

Related Questions

I have a storyboard iOS app that has a number of views I push
I have an Facebook enabled, iOS 5 app that uses a storyboard and segue
I have a normal UIViewController in my iPad storyboard. inside this viewcontroller I have
I have used tabbar controller using storyboard in application with iOS 6. In normal
I'm implementing a simple app with storyboard which has a button from a normal
I have this memory game app that I'm working on, trying to learn WP7.
I have a normal asp.net page containing some code that I want to measure
I have a normal UINavigationController with a UIViewController contained in it, when my view
Imagine you have a normal table view where each row is an item on
I have read that 'Normal' ARM instructions are fixed length - 32 bits. And

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.