views:

34

answers:

1

Hi,

I am just curious about what is the behavior of temporary directory in an iPhone app. (If my memory is correct there is a tmp directory in the same location as Documents)

What happen if I save some files there?, would they be deleted automatically when my app is terminated or should I do it manually? in that case What would it be the difference between Documents directory?

Thanks in advance

+1  A: 

Although temporary folder (path can be obtained using NSTemporaryDirectory() function) contents is not guaranteed to persist between application launches, but in general it is developer responsibility to remove unnecessary temp files. The differences from documents folder are:

  • As mentioned above tmp folder contents can be deleted by system (but may not)
  • tmp folder content is not backed up by itunes
Vladimir