iPhone Xcode 4 file bundle problem-Collection of common programming errors
From the looks of it, list seems to be a ivar. If that is correct then you are assigning an autoreleased value to list. If you do access this later, you will be trying to access a deallocated object and hence have an error. If you have an retained property defined for list, then you can do,
self.list = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:documentsDirectory error:NULL];
If you for some reason, having a property isn’t possible then do simply call retain on it like this,
list = [[[NSFileManager defaultManager] contentsOfDirectoryAtPath:documentsDirectory error:NULL] retain];