在pad中调试一个用UIScrollView addSubview加载UIViewController中的view包含大量图片闪退,没有提示崩溃信息,求帮忙解决。

xamppobjc 发布于 2013年12月05日 | 更新于 2013年12月05日
无人欣赏。
测试环境:ipad2 
系统版本:6.1
其中当页面滑动的时候,未显示的图片我已经设为nil了,view我也remove掉了,但是滚动到20也左右就出现闪退了,求帮忙分析分析,采用ARC开发的。

 1. 在Organizer中的Console文件最后提示如下(在标准输出里面未输出):

Dec  5 10:31:38 Administratorteki-iPad UserEventAgent[24] : jetsam: kernel termination snapshot being created
Dec  5 10:31:38 Administratorteki-iPad com.apple.launchd[1] (com.apple.mobile.assertion_agent[9576]) : (com.apple.mobile.assertion_agent) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Dec  5 10:31:38 Administratorteki-iPad com.apple.launchd[1] (com.apple.mobile.assertion_agent[9576]) : (com.apple.mobile.assertion_agent) Exited: Killed: 9
Dec  5 10:31:38 Administratorteki-iPad com.apple.launchd[1] (com.apple.softwareupdateservicesd[9557]) : (com.apple.softwareupdateservicesd) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Dec  5 10:31:38 Administratorteki-iPad com.apple.launchd[1] (com.apple.softwareupdateservicesd[9557]) : (com.apple.softwareupdateservicesd) Exited: Killed: 9
Dec  5 10:31:38 Administratorteki-iPad com.apple.launchd[1] (com.apple.timed[9504]) : (com.apple.timed) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Dec  5 10:31:38 Administratorteki-iPad com.apple.launchd[1] (com.apple.timed[9504]) : (com.apple.timed) Exited: Killed: 9
Dec  5 10:31:38 Administratorteki-iPad com.apple.launchd[1] (com.apple.itunesstored[9556]) : (com.apple.itunesstored) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Dec  5 10:31:38 Administratorteki-iPad com.apple.launchd[1] (com.apple.itunesstored[9556]) : (com.apple.itunesstored) Exited: Killed: 9
Dec  5 10:31:38 Administratorteki-iPad com.apple.launchd[1] (com.apple.mobile.installd[9546]) : (com.apple.mobile.installd) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Dec  5 10:31:38 Administratorteki-iPad com.apple.launchd[1] (com.apple.mobile.installd[9546]) : (com.apple.mobile.installd) Exited: Killed: 9
Dec  5 10:31:38 Administratorteki-iPad com.apple.launchd[1] (com.apple.networkd_privileged[9675]) : (com.apple.networkd_privileged) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Dec  5 10:31:38 Administratorteki-iPad com.apple.launchd[1] (com.apple.networkd_privileged[9675]) : (com.apple.networkd_privileged) Exited: Killed: 9
Dec  5 10:31:38 Administratorteki-iPad com.apple.launchd[1] (com.apple.lsd[9660]) : (com.apple.lsd) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Dec  5 10:31:38 Administratorteki-iPad com.apple.launchd[1] (com.apple.lsd[9660]) : (com.apple.lsd) Exited: Killed: 9
Dec  5 10:31:38 Administratorteki-iPad backboardd[5064] : BKSendGSEvent ERROR sending event type 3001: (ipc/send) invalid destination port (0x10000003)
Dec  5 10:31:38 Administratorteki-iPad com.apple.launchd[1] (com.apple.tccd[9536]) : (com.apple.tccd) Exited: Killed: 9
Dec  5 10:31:38 Administratorteki-iPad com.apple.launchd[1] (UIKitApplication:com.huayu.opentdianxin[0x3213][9677]) : (UIKitApplication:com.huayu.opentdianxin[0x3213]) Exited: Killed: 9
Dec  5 10:31:38 Administratorteki-iPad com.apple.debugserver-199[9670] : 1 +0.000000 sec [25c6/1303]: error: ::read ( 5, 0x2fe809fc, 18446744069414585344 ) => -1 err = Bad file descriptor (0x00000009)
Dec  5 10:31:38 Administratorteki-iPad backboardd[5064] : Application 'UIKitApplication:com.huayu.opentdianxin[0x3213]' exited abnormally with signal 9: Killed: 9
Dec  5 10:31:39 Administratorteki-iPad ReportCrash[9680] : MS:Notice: Installing: (null) [ReportCrash] (793.00)
Dec  5 10:31:39 Administratorteki-iPad timed[9681] : MS:Notice: Installing: com.apple.timed [timed] (793.00)
Dec  5 10:31:40 Administratorteki-iPad timed[9681] : libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Dec  5 10:31:40 Administratorteki-iPad ReportCrash[9680] : libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Dec  5 10:31:40 Administratorteki-iPad ReportCrash[9680] : Saved crashreport to /Library/Logs/CrashReporter/LowMemory-2013-12-05-103140.plist using uid: 0 gid: 0, synthetic_euid: 0 egid: 0
Dec  5 10:31:40 Administratorteki-iPad UserEventAgent[24] : jetsam: kernel termination snapshot being created
Dec  5 10:31:43 Administratorteki-iPad timed[9681] : (Note ) CoreTime: Want active time in 15.61hrs. Need active time in 98.94hrs.
Dec  5 10:31:47 Administratorteki-iPad profiled[9671] : (Note ) profiled: Idled.
Dec  5 10:31:47 Administratorteki-iPad profiled[9671] : (Note ) profiled: Service stopping.
Dec  5 10:31:50 Administratorteki-iPad ReportCrash[9687] : MS:Notice: Installing: (null) [ReportCrash] (793.00)
Dec  5 10:31:50 Administratorteki-iPad ReportCrash[9687] : Not saving Jetsam log because no data from the kernel.
Dec  5 10:31:50 Administratorteki-iPad securityd[9689] : MS:Notice: Installing: (null) [securityd] (793.00)
Dec  5 10:31:51 Administratorteki-iPad crash_mover[9691] : MS:Notice: Installing: (null) [crash_mover] (793.00)
Dec  5 10:31:51 Administratorteki-iPad afcd[9693] : MS:Notice: Installing: (null) [afcd] (793.00)
Dec  5 10:31:51 Administratorteki-iPad afcd[9693] : Max open files: 78
Dec  5 10:32:01 Administratorteki-iPad crash_mover[9697] : MS:Notice: Installing: (null) [crash_mover] (793.00)

 1. Device Logs信息如下:

Incident Identifier: 6807A6F3-81CE-42E4-9924-5614C70BF420
CrashReporter Key:   cc5fc87b25b278e32354b13d68b8f3b7417e308e
Hardware Model:      iPad2,4
OS Version:          iPhone OS 6.1 (10B141)
Kernel Version:      Darwin Kernel Version 13.0.0: Sun Dec 16 19:59:15 PST 2012; root:xnu-2107.7.55~11/RELEASE_ARM_S5L8942X
Date:                2013-12-05 10:31:39 +0800
Time since snapshot: 324 ms

Free pages:        337
Active pages:      8040
Inactive pages:    3982
Throttled pages:   89450
Purgeable pages:   0
Wired pages:       26081
Largest process:   LYZZ

Processes
     Name                                           rpages       recent_max       [reason]          (state)

mobile_assertion           167              167         [vm]         (daemon) (idle)
           timed <129ae7acc9bc3209a60ac42d49b0d89f>          234              234         [vm]         (daemon) (idle)
    itunesstored <44d1bc6b3088390bb5c58d052a71f8f2>          869              869         [vm]         (daemon) (idle)
softwareupdatese <3a50dafa40f73b8cb2e5a092873b9521>          334              334         [vm]         (daemon) (idle)
             lsd <566268cf717b335e98ddba10ca9315ab>          203              203         [vm]         (daemon) (idle)
        installd <117f65beb8cb38da8e0844256c65e402>          344              344         [vm]         (daemon) (idle)
networkd_privile           144              144         [vm]         (daemon) (idle)
            tccd <2778744d99a530c9a7d5e57a19b60008>          185              185         [vm]         (daemon)
            LYZZ <3eab03adec1e3eae8454be2cbacaceb5>        91895            91895         [vm]         (audio) (frontmost) (resume)
            ptpd <096297a7a40f318290a972274cc44d87>          308              308                      (daemon)
   iaptransportd <9b3cf56b4db13761bbd8ac2e0ff099be>          236              236                      (daemon)
         syslogd           161              161                      (daemon)
        profiled <076cdfb96d15376c9150de528436cb79>          361              361                      (daemon)
       locationd           698              698                      (daemon)
    mediaserverd           626              626                      (daemon)
           wifid <58f83da76ff33b889122fa80d7a262e3>          359              359                      (daemon)
     SpringBoard <6b02e8b9913d39caa24f7927cc9fa77b>         2405             2405                     
      backboardd <8db19add2bf937628cd17abdf8931372>         4945             4945                      (daemon)
  UserEventAgent <7ee3410c25e4372d84e93318fe42696b>          471              471                      (daemon)
     debugserver             0                0                      (daemon)
   syncdefaultsd           232              232                      (daemon)
    syslog_relay             0                0                      (daemon)
notification_pro <08df322fbe7739199f78852a511169ef>          175              175                      (daemon)
            afcd <3bd960d39c9f3972a10923db0e687b4a>          162              162                      (daemon)
filecoordination <28ca39773e933ed2aa92c117c661d056>          149              149                      (daemon)
       distnoted <699b8253736233b29180419f139e8c01>          119              119                      (daemon)
            apsd <5be27dc5ea5234319bc4b47380e42174>          372              372                      (daemon)
        networkd <49064febbe553338bd98051399022da4>          185              185                      (daemon)
      aggregated <8d4c44657791321db55a3add01c2beb2>          106              106                      (daemon)
          powerd <63673a83ac9c3cf98fdc75df8ba70fd0>          151              151                      (daemon)
       securityd           151              230                      (daemon)
        BTServer           344              344                      (daemon)
         configd           408              408                      (daemon)
  fairplayd.K93a           177              177                      (daemon)
       fseventsd <3ea853cb95de3aa48972aa42637af69a>          357              357                      (daemon)
         imagent <2b64c6111aa63b179a15afd6a76a6696>          352              352                      (daemon)
   mDNSResponder <1e651badfb7033a68a73a667ec480a08>          233              233                      (daemon)
       lockdownd <45fceb30c68c345198c00582d6189499>          269              269                      (daemon)
CommCenterClassi           316              316                      (daemon)
         notifyd <67a17b0c297e3785a9e09b8e72f3636a>          175              175                      (daemon)

**End**

共14条回复
tinyfool 回复于 2013年12月05日

看样子就是你Loading大量图片在主线程,系统发现主线程长期工作,就给你干掉了

在iOS里面复杂的Loading建议扔到后台线程去,这样不会给用户造成卡顿,也不会让系统干掉

顺便召唤无敌召唤兽 @sycx 大师,你看看我说的对么?

xamppobjc 回复于 2013年12月05日

1楼 @tinyfool 如果慢慢的滑动UIScrollView的话,他不会崩溃,就那种一直使劲儿滑使劲儿滑的情况下,到第20页的时候必须崩溃。在主线程里面一直长期工作就会被系统干掉啊?我试试用后台线程去加载试试看呢,看能否实现不。

  • ps:播客很不错哟~
tinyfool 回复于 2013年12月05日

2楼 @xamppobjc :) 苹果很在乎体验的,App如果主线程卡住,就是说有任务执行,长期不把控制权还给系统UI,干掉是很有可能的

xamppobjc 回复于 2013年12月05日

3楼 @tinyfool 按照这个意思,我是不是可以做如下理解:在我慢慢滑动UIScrollview的情况下,是不是就会在滑动的过程中,会交还控制权给系统;在使劲儿滑动的时候,是不是就没来的及交还,所以系统就直接给我干死了?谢谢tiny。

tinyfool 回复于 2013年12月05日

4楼 @xamppobjc 对,不是要一股脑的把信息都load进来,而是按需loading,然后,后台loading。

Linruin 回复于 2013年12月05日

不是的,我就遇到和你一样的问题,是因为图片太多,堆积在内存中没释放到时内存不足系统直接杀掉程序。我已经做了一个可以支持大量大尺寸图片显示的scrollview。需要的话可以联系我。

Linruin 回复于 2013年12月05日

其实实现的远离也很简单,做一个缓冲区,比方说你当前界面需要同时展示1张大图,那么你的缓冲区就可以缓冲3张(前一张,正在显示的一张,和后一张),这样子你始终在内存中只有三张,当滚动时,根据滚动的方向,卸掉一张,加载一张即可。

Linruin 回复于 2013年12月05日

1楼 @tinyfool 你好,能否加下qq?445242970

tinyfool 回复于 2013年12月05日

8楼 @Linruin 为什么要加QQ,我又不上

xamppobjc 回复于 2013年12月05日

5楼 @tinyfool 确实是按需加载进来的,我用内存查看工具看了,内存live的那块一直也不高,就是总的占的很高。

6楼 @Linruin 能不能分享一下你的demo,学习学习啊。

Linruin 回复于 2013年12月05日

10楼 @xamppobjc 加我qq,发给你

xamppobjc 回复于 2013年12月05日

11楼 @Linruin 加了第二遍了,麻烦了,谢谢啊。

xamppobjc 回复于 2013年12月05日

9楼 @tinyfool 岁月成星不屌我的话题。。。

xamppobjc 回复于 2013年12月05日

9楼 @tinyfool

8楼 @Linruin

我刚才换个padmini一代,系统配置是跟pad2一样的,区别就是mini的系统是iOS7的,在mini的iOS7上面就没有问题,在pad2的iOS6上就有问题,这大概是什么原因啊,另外我试了在GCD里面异步去做资源加载,但是还是会闪退,没有提示崩溃信息,求help。。

本帖有14个回复,因为您没有注册或者登录本站,所以,只能看到本帖的10条回复。如果想看到全部回复,请注册或者登录本站。

登录 或者 注册
相关帖子

[顶 楼]
|
|
[底 楼]
|
|
[首 页]