我在我的游戏中使用 appoxee 消息服务..
我的第一层是“StartUpLayer” StartUpLayer 等待 StageLayer 完成加载......然后进入声明我的 UIButton 的舞台层......
但是我的 UIButton 第一次出现在 StartUpLater 中并一直存在直到它被释放。我该如何解决这个问题?谢谢..
应用委托
- (void) AppoxeeNeedsToUpdateBadge:(int)badgeNum hasNumberChanged:(BOOL)hasNumberChanged
{
if(badgeNum > 0)
{
badgeText = [NSString stringWithFormat:@"%d",badgeNum];
}
StageLayer *stgLayer = [[StageLayer alloc] init];
[[AppoxeeManager sharedManager] addBadgeToView:stgLayer.AppoxeeButton badgeText:badgeText badgeLocation:CGPointMake(0,0) shouldFlashBadge:hasNumberChanged];
[UIApplication sharedApplication].applicationIconBadgeNumber = badgeNum;
}
阶段层初始化
AppoxeeButton = [[UIButton alloc] initWithFrame:CGRectMake(100,100,100,100)];
[AppoxeeButton setBackgroundImage:[UIImage imageNamed:@"messages-button.png"] forState:UIControlStateNormal];
[AppoxeeButton setTitle:@"" forState:UIControlStateNormal];
[AppoxeeButton addTarget:self action:@selector(inboxPressed) forControlEvents:UIControlEventTouchUpInside];
[[[CCDirector sharedDirector] openGLView] addSubview:AppoxeeButton];