Methode nicht aufgerufen, mit dispatch_async und wiederholen NSTimer

Bin ich, eine app zu entwickeln, wo ich anrufen möchte-Methode in separaten Warteschlange mit dispatch_async. Möchte ich nennen, dass die Methode wiederholt nach einer bestimmten Zeitspanne. Aber die Methode ist nicht immer genannt.

Weiß ich nicht was ist falsch. Hier ist mein code:

dispatch_async( NotificationQueue, ^{

        NSLog(@"inside queue");
        timer = [NSTimer scheduledTimerWithTimeInterval: 20.0
                                                 target: self
                                               selector: @selector(gettingNotification)
                                               userInfo: nil
                                                repeats: YES];

        dispatch_async( dispatch_get_main_queue(), ^{
            //Add code here to update the UI/send notifications based on the
            //results of the background processing

        });
    });

-(void)gettingNotification {
    NSLog(@"calling method ");
}
InformationsquelleAutor user2185354 | 2013-11-15
Schreibe einen Kommentar