我在 uitableview 中显示了歌曲标题列表以及“购买”按钮。当点击该按钮时,我正在显示 MBProgressHUD。但有时它没有被显示。它也禁用了用户交互,因为它在下面的代码中。
但为什么有时它不显示 MBProgressHUD?
请告诉我,非常感谢。
下面是代码
-(void) buySong:(UIButton *)button
{
self.view.userInteractionEnabled = NO;
self.navigationController.navigationBar.userInteractionEnabled = NO;
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.labelText = @"Proessing...";
hud.yOffset = -80;
UITableViewCell *cell = (UITableViewCell *)[[button superview] superview];
NSIndexPath *indexPath = [[self tblViewChildrenPoems] indexPathForCell:cell];
PSSongTags *songTags = [self.songsArray objectAtIndex:indexPath.row];
[ [PurchaseViewController sharedPurchaseManager] startPurchase:songTags];
}