iphone - Files Deleting from Table View but not from Document Directory by using Swipe Gesture -


if (editingstyle == uitableviewcelleditingstyledelete){          nsfilemanager *filemanager = [[nsfilemanager alloc]init];                 nsstring *filepath = [documentsdirectory          stringbyappendingpathcomponent:[nsstring stringwithformat:@"%@ ",[self->localsongs objectatindex:indexpath.row]]];                 [filemanager removeitematpath:filepath error:nil];          [self->localsongs removeobjectatindex:indexpath.row];         [tableview deleterowsatindexpaths:[nsarray arraywithobject:indexpath] withrowanimation:uitableviewrowanimationfade];         [self.tableview reloaddata];     } 

any suggestion?

following code how delete file document directory :

nsstring *imagename = @"name of file"     nsfilemanager *filemanager = [nsfilemanager defaultmanager];     nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes);     nsstring *documentsdirectory = [paths objectatindex:0];      [filemanager removeitematpath:[documentsdirectory stringbyappendingpathcomponent:imagename] error:nil]; 

Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -