Giter Club home page Giter Club logo

我写了一个tabview加载多张网络图片的demo,在模拟器中快速滑动,加载图片时,是好的。

问题:在手机上一运行,发现xcode自动打印这个log 错误“JPEGDecompressSurface : Picture decode failed: e00002d1 ”,同时真机上的图片加载不完全。

因为我这个加载多张网络图片的demo包含图片缓存到磁盘中,最终定位原因是多张图片写磁盘时,出现问题。

解决办法:将写图片到磁盘放到异步线程中去执行,然后就不报上面的错误了,同时真机上的图片也完全加载出来了。

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
BOOL a = [[LJCacheDataManage shareInstance]writeFile:self.recieveData withName:self.imageUrl];
if (a) {
CHDebugLog(@"-----文件写入成功");
}
});

robinson_911's Projects

zan-proxy icon zan-proxy

An extensible proxy for PC/Mobile/APP developer

zheng icon zheng

基于Spring+SpringMVC+Mybatis分布式敏捷开发系统架构,提供整套公共微服务服务模块:集中权限管理(单点登录)、内容管理、支付中心、用户管理(支持第三方登录)、微信平台、存储系统、配置中心、日志分析、任务和通知等,支持服务治理、监控和追踪,努力为中小型企业打造全方位J2EE企业级开发解决方案。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.