lundi 4 mai 2015

time delay in an else statement for multiple method calls?

I have an If - Else Statement. When the Else Statement is called, i want to delay all method calls in the else Statement.

Looks like this:

if (xy) {
        [self.method1];
        [self method2];


    } else {

       [self.method3];
       [self method4];
       [self.method5];
       [self.mehtod6];

    }

I tried it with call every method (3-6) with performSelector:withObject:afterDelay:

[self performSelector:@selector(method3) withObject:nil afterDelay:1.0];

But it still don't works.

Can i set a timer in the else statement that delays the whole else statement for 1 sec?

Aucun commentaire:

Enregistrer un commentaire