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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:37:37+00:00 2026-05-27T19:37:37+00:00

So, I am trying to merge two classes, a Bullet Class and a BulletCache

  • 0

So, I am trying to merge two classes, a Bullet Class and a BulletCache class from one program into a single class of another.

The Bullet Class is a subclass of CCSprite, and the BulletCache class is a subclass of CCNode.

I’m trying to create a Bullet Class that is a subclass of Item, which is a subclass of LevelObject, which is a subclass of CCNode. So you can see how it ties together.

My new Bullet class (as declared in the Items class file) has these instance variables, the upper two are from the Bullet Class, while the bottom two are from the BulletCache.

{
  CGPoint velocity;
  bool isPlayerBullet;
  CCSpriteBatchNode* batch;
  int nextInactiveBullet;
}

The CCSpriteBatchNode* is not recognized by Xcode in this project, despite all my efforts. At the top of the file I wrote

@class CCNode; 

Yet the CCSpriteBatchNode is still undefined. Any help and advice is much appreciated.

Question in a nutshell: How the hell does I get CCSpriteBatchNode (a common cocos2d class) to be defined in this project?

The other issue is that the @interface Item : LevelObject and @interface Bullet : Item are written on the same file. I tried the @class CCSpriteBatchNode; and no success.

I also tried "#import CCSpriteBatchNode.h" and still no success.

Xcode seems insistent that CCSpriteBatchNode class does not exist

  • 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-27T19:37:37+00:00Added an answer on May 27, 2026 at 7:37 pm

    Assuming I follow you correctly, I’d think your class layout would look something like this (note, I’ve separated mine into separate files; if you use the same files, in general, the declaration in your file should follow the same order from top to bottom):


    LevelObject.h:

    #import "CCNode.h"
    
    @interface LevelObject : CCNode {
    
    }
    
    @end
    

    Item.h:

    #import "LevelObject.h"
    
    @interface Item : LevelObject {
    
    }
    
    @end
    

    Bullet.h:

    #import "Item.h"
    
    @class CCSpriteBatchNode;
    
    @interface Bullet : Item {
      CGPoint velocity;
      bool isPlayerBullet;
      CCSpriteBatchNode* batch;
      int nextInactiveBullet;
    }
    
    @end
    

    Bullet.m:

    #import "Bullet.h"
    #import "CCSpriteBatchNode.h"
    
    @implementation Bullet
    
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to merge two docx-documents into one docx-document using OpenXML SDK 2.0. The
I am trying to merge two or more postscript files into one. I tried
I am trying to merge two ggplot2 plots into one based on this table:
I have the following two class functions which I'm attempting to merge into one
I am trying to merge two .net regular expressions into one. The following expressions
Im trying to find simplest way to merge two arrays into the third one,
I am trying to merge two examples from the ApiDemos so one overlay over
I'm trying to shrink and merge two A4 PDF pages into one A4 page
I am trying to merge two files. One of them is .net3.5 wpf application
I am trying to merge two similar tables (not exact) to one table. Getting

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.