0

I got quite a nice title:)

My main class is

@interface StartLayer : CCScene

I used

HelpView* hp = [[HelpView alloc]initWithFrame:CGRectMake(0, 0, 320, 520)];
CCUIViewWrapper* wrapper = [CCUIViewWrapper wrapperForUIView:hp];
[self addChild:wrapper];

to add class

@interface HelpView : UIView

I have got two more classes that have HelpView as their super class

@interface GameOverMenu : HelpView <UITextFieldDelegate>

@interface PlayScene : HelpView

In my GameOverMenu or PlayScene I need to remove HelpView (I guess all of subViews will be removed too) as a child of StartLayer and I totally need HelpView to have UIView as superclass. Any thoughts?

Alexander
  • 233
  • 1
  • 4
  • 14

1 Answers1

0

[self.parent removeFromParentAndCleanup:YES] not working ?

Michal Zaborowski
  • 5,039
  • 36
  • 35
  • I don't have such option in self. I guess it would work if StartLayer is superclass for HelpView, but I need it to be UIView – Alexander Apr 25 '12 at 21:58
  • Do StartLayer as a singleton, next set a tag to wrapper, wrapper.tag = (some enum or int) 1, and in HelpView you can get wrapper and remove it, ((CCUIViewWrapper*)[[StartLayer sharedInstance] getChildByTag:wrapper]) removeFromParentAndCleanup:YES]; – Michal Zaborowski Apr 27 '12 at 20:33