'接收者类型"CCParticleBatchNode";对于班级消息是前向声明" [英] 'Receiver type "CCParticleBatchNode" for class message is a forward declaration'

查看:66
本文介绍了'接收者类型"CCParticleBatchNode";对于班级消息是前向声明"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标题不言而喻.我通过从github下载文件,删除项目中的cocos2d项目并重新添加来安装cocos2d 1.1.

The title speaks for itself. I installed cocos2d 1.1 by downloading the files from github, removing the cocos2d project inside my project and re-adding it.

我的头文件中有一个'@class CCParticleBatchNode',前缀和相关的实现文件中都有#import"cocos2d.h".当我浏览到CCParticleBatchNode应该位于的位置时,它在那里.

I have a '@class CCParticleBatchNode' in my header file and #import "cocos2d.h" both in my prefix and in the relevant implementation file. When i browse to the location CCParticleBatchNode should be, it is there.

那么,有人知道这可能是什么问题吗?:)

So, does someone know what the problem might be? :)

这是一些代码.

#import "PrecipicationLayer.h"
#import "cocos2d.h"

@implementation PrecipicationLayer
@synthesize cloudLayer;
- (id)init
{
    self = [super init];
    if (self)
    {
        rain = [CCParticleRain node];
        rainBatch = [CCParticleBatchNode particleBatchNodeWithFile:@"Raindrop48px.png" capacity:400 useQuad:YES additiveBlending:NO];
        [self addChild:rainBatch];

        [self schedule:@selector(tick:)];
    }
return self;
}

和头文件:

#import <Foundation/Foundation.h>
#import "cocos2d.h"
@class CCParticleBatchNode;

@interface PrecipicationLayer : CCLayer {
    CCParticleBatchNode *rainBatch;
}

@end

所有不相关的部分均已删除.

All irrelevant parts have been removed.

推荐答案

哦,好吧……常见的cocos2d升级麻烦.

Oh well … the usual cocos2d upgrade troubles.

个人而言,我只需安装cocos2d 1.1模板(假设它们是最新的),然后基于其中一个cocos2d模板创建一个项目.然后将您的源代码和资源添加到这个新创建的项目中.这通常比尝试替换和更新现有项目中的cocos2d代码要好得多.

Personally I would simply install the cocos2d 1.1 templates (assuming they're up to date) and create a project based on one of the cocos2d templates. Then add your source code and resources to this newly created project. This usually works a lot better than trying to replace and update the cocos2d code in an existing project.

我想您的问题可能是来自删除cocos2d项目,而不是来自硬盘驱动器的文件.这意味着仍然有一些旧版本的剩余文件仍包含在项目中并已构建.您肯定要删除所有现有的cocos2d文件,然后再将新的cocos2d文件移动到位.

I guess that your problem may be coming from removing the cocos2d project but not the files from your hard drive. That means there can still be some left-over files from the old version that are still included in the project and built. You definitely want to delete all existing cocos2d files before moving the new cocos2d files in place.

最后,不要排除从github下载的版本被破坏的可能性.这不是第一次.请尝试使用可从网站下载的版本,并请注意,此时1.1只是一个beta.

Finally, don't rule out the possibility that the version you downloaded from github is broken. It wouldn't be the first time. Try using the downloadable version from the website instead, and keep in mind that 1.1 is just a beta at this point in time.

提示:将来您可能希望使用 Kobold2D 创建cocos2d项目,它具有

Tip: in future you may want to create cocos2d projects with Kobold2D, it has an upgrade tool that does away with all those troubles.

这篇关于'接收者类型"CCParticleBatchNode";对于班级消息是前向声明"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆