我寫這樣的:問題用的NSTimer的iOS SDK
[NSTimer scheduledTimerWithTimeInterval:900 target:self selector:@selector(CallGetCounts) userInfo:nil repeats:YES];
這意味着我不想重複我的定時器,每5分鐘,但我的計時器不重複,不能夠找到原因
可以在任何請告訴我答案。
我在「AppDelegate
」 - >「- (void)applicationDidEnterBackground:(UIApplication *)application
」中寫了這個方法。
i相測試 「[的NSTimer scheduledTimerWithTimeInterval:1.0目標:自選擇器:@selector(CallGetCounts)USERINFO:無重複:YES];」也在那個時候,我的計時器不重複 – user1179681 2012-03-15 09:59:03
什麼樣的對象是「自我」?它被釋放了嗎?它實際上是否響應'CallGetCounts'方法?我們可以看到你的一些代碼嗎? – jtbandes 2012-03-15 10:00:34
我在「AppDelegate」 - >「 - (void)applicationDidEnterBackground:(UIApplication *)application」方法中寫了這個。 – user1179681 2012-03-15 10:02:06