1 Reply
      Latest reply on Nov 21, 2016 3:31 AM by eskimo
      gantastic Level 1 Level 1 (0 points)

        I get this error after leaving my app running for about half an hour. It is fetching a json feed every few seconds and will eventually stop doing so when this error occurs.

        • Re: what does __NSCFLocalDownloadFile: error 24 opening for ioChannel mean?
          eskimo Apple Staff Apple Staff (13,035 points)

          Error 24 is almost certainly EMFILE, which means your app has run out of file descriptors.  You usually get this when someone ‘leaks’ a file descriptor, that is, opens a file but doesn’t close it.  This could be code in the OS but it’s more likely to be your code.

          Does the problem reproduce on the simulator?  If so, you can run lsof to figure out what files are open in your process, and from there hunt the leak.  For example:

          $ lsof -p `pgrep xxis2`
          xxis2  9601 quinn  0r    CHR    3,2      0t0      302 /dev/null
          xxis2  9601 quinn  1u    CHR  16,4      0t0    1363 /dev/ttys004
          xxis2  9601 quinn  2u    CHR  16,4      0t0    1363 /dev/ttys004
          xxis2  9601 quinn  3u  KQUEUE                          count=2, state=0x12
          xxis2  9601 quinn  4r    REG    1,4        0 81530947 …/memory_warning_simulation
          xxis2  9601 quinn  5u    unix …          0t0          ->0x5a9f59bfb599f0e9
          xxis2  9601 quinn  6r    REG    1,4    5588 81132880 …/US.uchr

          where xxis2 is the name of my app.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"