测试环境: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**
不是的,我就遇到和你一样的问题,是因为图片太多,堆积在内存中没释放到时内存不足系统直接杀掉程序。我已经做了一个可以支持大量大尺寸图片显示的scrollview。需要的话可以联系我。
其实实现的远离也很简单,做一个缓冲区,比方说你当前界面需要同时展示1张大图,那么你的缓冲区就可以缓冲3张(前一张,正在显示的一张,和后一张),这样子你始终在内存中只有三张,当滚动时,根据滚动的方向,卸掉一张,加载一张即可。