简体   繁体   中英

IOS: UIImage fileNamed -> Too many files open

In my IOS application I have the 5 UIImageViews which load a bunch of images using the [UIImageView fileName:...] API. In IOS 4.2, im getting application crashes because of the following error:

ImageIO: CGImageRead_mapData 'open' failed '/var/mobile/Applications/6CCEFE3D-198A-460A-B496-EA4C11F4200D/EKS.app/e250.png'
     error = 24 (Too many open files)

/Developer/usr/lib/libXcodeDebuggerSupport.dylib: open() failed with errno=24
/Developer/usr/lib/libXcodeDebuggerSupport.dylib: stat() failed with errno=0")

How do I go about properly closing the files which are opened using this API?

Thanks

Try to use initWithContentsOfFile instead of imageNamed . If there too many images imageNamed try autorelease the file. I think that's why this warning coming.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM