cocos2d-x常用IOS模块

1 显示对话框

UIAlertView *alert = [[UIAlertViewalloc]
                              initWithTitle:@""
                              message: @"请求失败!"
                              delegate: nil
                              cancelButtonTitle:@"确定"
                              otherButtonTitles:nil];
        [alert show];
        [alert release];
注意不能在cocos2d切换场景时调用该函数,否则会发生异常。

2 显示进度

-(void)hideHUD
{
    UIApplication * app = [UIApplication sharedApplication];
    UIWindow * window = [app.windows objectAtIndex:0];
    [MBProgressHUD hideHUDForView:window animated:YES];
}

-(void)showHUD
{
    UIApplication * app = [UIApplication sharedApplication];
    UIWindow * window = [app.windows objectAtIndex:0];
    [[MBProgressHUD showHUDAddedTo:window animated:YES] setLabelText:@"正在请求AppStore..."];
}


你可能感兴趣的:(cocos2d-x常用IOS模块)