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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:18:27+00:00 2026-05-26T18:18:27+00:00

I am starting to learning Cocos2D for iPhone. I see the basic template has

  • 0

I am starting to learning Cocos2D for iPhone. I see the basic template has a viewController but when it runs it loads HelloWorldLayer, instead of the viewController view.

When you work with a viewController, you used to have the main logic for that controller on the .m, but as Cocos2D works in another way I wonder where should I put the main logic code.

What I mean is this. Developing with Cocos2D I will have a bunch of these “layer” files and as I pass the scenes, one of these files will be active at one time but now imagine that I am building an app that has in-app purchases or coredata. I have to have one central place where this common logic to handle sales and the database should reside. Where is the best practice? To put it on the viewController Cocos2D creates or what? How do you do that?

Where do I put the code so it will initialize when the app runs and before showing the first scene?

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-26T18:18:28+00:00Added an answer on May 26, 2026 at 6:18 pm

    The startup code in Cocos2D is in the app delegate applicationDidFinishLaunching method. So you may want to initialize your loading code there.

    The issue you’re experiencing may be due to the incorrect setup of the view controller by Cocos2D, which leads to the view controller’s viewDidLoad method not to be called. You can call that manually from applicationDidFinishLaunching however, after the line: rootViewController.view = glView

    You’ll find plenty of Tutorials that shed more light on this here: http://www.raywenderlich.com/

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

Sidebar

Related Questions

I'm a complete Xcode/Objective-C/Cocoa newbie but I'm learning fast and really starting to enjoy
I'm starting learning Ruby on Rails. So my application, like every Rails app, has
Background: I'm (jumping on the bandwagon and) starting learning about iPhone/iPad development and Objective-C.
Sorry if it's a silly question , but I'm just starting learning GWT and
I am just starting out learning to build interfaces, but the book I am
I'm just starting learning CDI and Java EE 6 but I found this piece
This seems to match the rules I have defined, but I only starting learning
just considering starting to learning python but I have one concern before I invest
I'm learning J and starting with something basic; adding the multiples of 3 and
I'm just starting out learning python (for webapp usage) but I'm confused as to

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.