ios - Deleting all the files in the iPhone sandbox (documents folder)? -


is there easy way delete files(images) saved in documents folder of app?

nsfilemanager *filemgr = [[[nsfilemanager alloc] init] autorelease]; nserror *error = nil; nsarray *directorycontents = [filemgr contentsofdirectoryatpath:documentsdirectory error:&error]; if (error == nil) {     (nsstring *path in directorycontents) {         nsstring *fullpath = [documentsdirectory stringbyappendingpathcomponent:path];         bool removesuccess = [filemgr removeitematpath:fullpath error:&error];         if (!removesuccess) {             // error handling             ...         }     } } else {     // error handling     ... } 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -