3

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

2
  • You say there are only 5 UIImageViews and a "bunch" of images? Can you post the code on how these images are replaced in the UIImageView? My guess is there's something not deallocating properly when you replace the image.
    – fbrereto
    Feb 2, 2011 at 5:01
  • I think i have isolated the problem. It has to do with the autorelease pools you have to instantiate when you spawn an NSThread.
    – abudker
    Feb 2, 2011 at 21:33

1 Answer 1

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.