Friday, 4 May 2012

Thread starting methods

[self performSelectorOnMainThread:@selector(makeMyProgressBarMoving) withObject:nil waitUntilDone:NO];

[NSThread detachNewThreadSelector:@selector(presentModal) toTarget:self withObject:nil];


 #import "MBProgressHUD.h"

<MBProgressHUDDelegate>

MBProgressHUD *HUD;


HUD=[[MBProgressHUD alloc] initWithView:self.view];
HUD.graceTime=0.5;
HUD.delegate=self;
[self.view addSubview:HUD];
[HUD showWhileExecuting:@selector(fetchData:) onTarget:self withObject:nil animated:YES];

#pragma mark - HUD delegate
- (void)hudWasHidden{
    [HUD removeFromSuperview];
}

No comments:

Post a Comment