转载地址:http://blog.sina.com.cn/s/blog_7fa6b06f0101aozb.html
- (IBAction)LoginBtnTouched:(id)sender
{
[self.view addSubview:HUD];
HUD.delegate = self;
HUD.labelText = @"正在加载...";
[HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
}
-(void)performSegueFunc
{
}
-(void)performSegueFunc2
{
}
#pragma mark -
#pragma mark Execution code
- (void)myTask {
// Do something usefull in here instead of sleeping ...
sleep(3);
}
- (void)myProgressTask {
// This just increases the progress indicator in a loop
float progress = 0.0f;
while (progress < 1.0f) {
progress += 0.01f;
HUD.progress = progress;
usleep(50000);
}
}