1
以下方法在viewController中。方法選擇器指向不同的對象
refreshTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(refreshLabels) userInfo:nil repeats:YES];
是否有可能在選擇器而不是當前對象中選擇appDelegate(或另一個類)中的方法?
,如:
AppDelegate *ad = (AppDelegate *) [[UIApplication sharedApplication] delegate];
refreshTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector([ad refreshLabels]) userInfo:nil repeats:YES];
謝謝!
我不敢相信我不知道這一點......謝謝! – Linus
歡迎您.. :) – janusbalatbat