IOS: file UIImageNamed & # 8594; Too many files open

In my IOS application, I have 5 UIImageViews that load a bunch of images using the API [UIImageView fileName: ...]. In iOS 4.2, when receiving applications is due to 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 to close files opened using this API?

thank

+3
source share
1 answer

Try using initWithContentsOfFileinstead imageNamed. If there are too many images, imageNamedtry auto-detecting the file. I think this is a warning.

+1
source

Source: https://habr.com/ru/post/1789367/


All Articles