gpt4 book ai didi

iphone - MBProgressHUD 混合 View

转载 作者:行者123 更新时间:2023-11-28 23:13:45 25 4
gpt4 key购买 nike

- (void) didClickDone{
if (isValide ==0) {
(...)
[newFormDataRequest setDelegate:self];
[newFormDataRequest startAsynchronous];
(...)
//show the label
[self showWithLabel];
}
}




# pragma mark - AsiHTTPRequest delegate methods
- (void)requestFinished:(ASIHTTPRequest *)request
{
NSLog(@"PostAdRequest = %@", [request responseString]);
HUD.customView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"37x-Checkmark.png"]] autorelease];
HUD.mode = MBProgressHUDModeCustomView;
HUD.labelText = @"Completed";
sleep(10);
[self hudWasHidden];
[self dismissModalViewControllerAnimated:YES];
}

在 AsiHTTPRequest 的肯定回答后,我正在尝试更改 MBPrograssHub。但观点保持不变。你知道为什么吗?

谢谢

最佳答案

因为 sleep(10) 不允许 UIThread 更新 HUD。

- (void)requestFinished:(ASIHTTPRequest *)request {
NSLog(@"PostAdRequest = %@", [request responseString]);
HUD.customView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"37x-Checkmark.png"]] autorelease];
HUD.mode = MBProgressHUDModeCustomView;
HUD.labelText = @"Completed";

[self performSelector:@selector(removeHUD) withObject:nil afterDelay:10.0f];
}

- (void) removeHUD {
[self hudWasHidden];
[self dismissModalViewControllerAnimated:YES];
}

关于iphone - MBProgressHUD 混合 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7308922/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com