【问题标题】:MBProgressHUD and performselector problem - iphoneMBProgressHUD 和 performselector 问题 - iphone
【发布时间】:2011-07-28 06:51:46
【问题描述】:

我将以下代码写入 MBProgressHUD:

HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
[self.view addSubview:HUD];
HUD.delegate = self;
HUD.labelText = NSLocalizedString(@"Loading Workbench", nil);
HUD.detailsLabelText = NSLocalizedString(@"please wait", nil);
[HUD showWhileExecuting:@selector(loadWorkbench) onTarget:self withObject:nil animated:YES];

loadWorkbench 方法中,我编写了如下代码:

[self performSelector:@selector(CallPrivateKwikis) withObject:nil afterDelay:0.1];

但是从这里 CallPrivateKwikis 永远不会被调用。我找不到问题。

请任何人帮忙解决这个问题。

提前致谢。

【问题讨论】:

    标签: iphone xcode mbprogresshud performselector


    【解决方案1】:
    [self performSelector:@selector(CallPrivateKwikis:) withObject:nil afterDelay:0.1];
    

    在 CallPrivateKwikis 末尾添加冒号。

    【讨论】:

    • 我的方法语法是这样的: - (void)CallPrivateKwikis,所以认为不需要添加冒号,但我添加了任何方式但没有用仍然遇到同样的问题
    • 将语法更改为 -(void) CallPrivateKwikis:(id)params。
    【解决方案2】:

    使用 HUD = [[MBProgressHUD alloc]initWithview:self.view]];
    安装的
    HUD = [MBProgressHUD showHUDAddedTo:self.view Animation:YES];那么你的问题就解决了

    【讨论】:

      猜你喜欢
      • 2011-03-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多