小编Bri*_*ian的帖子

从后台返回后,定时器循环偶尔会崩溃

我在最新的应用程序版本中遇到了一致的问题.我有一个在AppDelegate中运行的计时器,它每隔30秒调用一个函数来加载一个新的广告.我认为这是这场车祸的罪魁祸首.使用Crittercism,我有13个用户超过20次崩溃.用户大多使用IOS 6或其中的一些变体.这是它给我的日志:

SEGV_ACCERR

0 libobjc.A.dylib 0x3acd25b0 objc_msgSend + 16

1基金会0x3394b277 __NSFireDelayedPerform + 451

2 CoreFoundation 0x330125df CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 15

3 CoreFoundation 0x33012291 __CFRunLoopDoTimer + 273

4 CoreFoundation 0x33010f01 __CFRunLoopRun + 1233

5 CoreFoundation 0x32f83ebd CFRunLoopRunSpecific + 357

6 CoreFoundation 0x32f83d49 CFRunLoopRunInMode + 105

7 GraphicsServices 0x36b452eb GSEventRunModal + 75

8 UIKit 0x34e99301 UIApplicationMain + 1121

9 AutoScene 0x000031b7 main(main.m:7)

我的计时器是:

[NSTimer scheduledTimerWithTimeInterval:30 target:self selector:@selector(resetAdTimer) userInfo:nil repeats:YES];
Run Code Online (Sandbox Code Playgroud)

我不知道这是不是同样的问题,但我经历过从背景返回应用程序的时间,它只是挂起..它似乎也挂了30秒,这让我相信它是定时器代码.

这是管理广告获取的一种糟糕方式吗?计时器代码长时间进入后台时是否会搞砸?

谢谢你的帮助!

iphone ios6

5
推荐指数
1
解决办法
2713
查看次数

标签 统计

ios6 ×1

iphone ×1