NSTimer hört nicht mit invalidate auf
Ich füge so einen Timer hinzu
tim=[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(repeatTim) userInfo:nil repeats:YES];
[[NSRunLoop mainRunLoop] addTimer:tim forMode:NSDefaultRunLoopMode];
tim Es ist NSTimer-Eigentum meiner Klasse.
Dann stoppe ich es auf Knopfdruck wie
[[fbt tim] invalidate];
[fbt setTim:nil];
fbt es ist beispiel meiner klasse.
Wenn ich nur Invalidate anrufe, hört es nicht auf, aber wenn ich es auf Null setze, bekomme ich EXC_BREAKPOINT
Hier Code der repeatTim-Methode im Selektor
AppDelegate *appDelegate = [[UIApplication sharedApplication]delegate];
[appDelegate.wbv stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"intal()"]];
ich habe versucht anzurufendrin undungültig machen im
dispatch_async(dispatch_get_main_queue(), ^{})
es stoppt auch nicht den Timer.