user1165127
user1165127

Reputation: 13

Disable Button at a Process

how can i disable all Buttons at a Process. At my Project a Button download a File an when the download beginn i would disable all Buttons it is finish should be all Buttons work.

- (IBAction)grabURLInBackground:(id)sender{

    NSURL *url = [NSURL URLWithString:@"http://db.tt/x8imQ0C"];
    ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
    [request setDelegate:self];
    [request setDownloadDestinationPath:@"/var/root/The best of S.A.F.rar"];
    [request setDownloadProgressDelegate:progressView];
    [request startAsynchronous];

}

Upvotes: 0

Views: 293

Answers (1)

Mc.Lover
Mc.Lover

Reputation: 4994

an easy way is create IBOutletCollection for all of your buttons then you can disable them like this :

[myButtons makeObjectsPerformSelector:@selector(setUserInteractionEnabled:) withObject:nil];

for enabling again :

[myButtons makeObjectsPerformSelector:@selector(setUserInteractionEnabled:)];

Upvotes: 1

Related Questions