如何将 MBProgressHUD 与 MGTwitterEngine 集成
我两个都单独工作得很好,但是当我尝试像这样组合它们时:
- (IBAction)showWithLabel:(id)sender
{
HUD = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
[self.checkinsViewController.view addSubview:HUD];
HUD.delegate = self;
HUD.labelText = @"Sending tweet";
[HUD showWhileExecuting:@selector(tweet) onTarget:self withObject:nil animated:YES];
}
- (void)tweet { [_twEngine sendUpdate:@"Test tweet"]; }
我没有收到任何错误,但推文没有发送如果我放置:
[_twEngine sendUpdate:@"Test tweet"];
在 IBAction 中,它会发推文。如果我将推文更改为睡眠状态,HUD 就会正确显示。
有什么想法吗?
I've got both working great individually, but when I try to combine them like this:
- (IBAction)showWithLabel:(id)sender
{
HUD = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
[self.checkinsViewController.view addSubview:HUD];
HUD.delegate = self;
HUD.labelText = @"Sending tweet";
[HUD showWhileExecuting:@selector(tweet) onTarget:self withObject:nil animated:YES];
}
- (void)tweet { [_twEngine sendUpdate:@"Test tweet"]; }
I don't get any errors, but the tweet isn't sent If I place:
[_twEngine sendUpdate:@"Test tweet"];
In the IBAction, it tweets. If I change tweet to sleep, the HUD shows up properly.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
showHUDAddedTo:animated:
和showWhileExecuting:
方法是互斥的。您不能同时使用这两种方法来显示 HUD 。更改您的初始化程序以仅分配 HUD,它应该可以工作。
The
showHUDAddedTo:animated:
andshowWhileExecuting:
methods are mutually exclusive. You can't use both methods to show the HUD .Change your initializer to just allocate a HUD and it should work.