ゲームで appoxee メッセージ サービスを使用しています。
私の最初のレイヤーは「StartUpLayer」です。StartUpLayer は、StageLayer の読み込みが完了するのを待ちます..そして、UIButton が宣言されているステージ レイヤーに移動します..
ただし、私の UIButton は初めて StartUpLater に表示され、リリースされるまでそこにとどまります。この問題を解決するにはどうすればよいですか? ありがとう..
AppDelegate
- (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];