Store a picture locally
Nsarray *dirarray = nssearchpathfordirectoriesindomains (nscachesdirectory, Nsuserdomainmask, YES); *path = [Dirarray firstobject]; = [path stringbyappendingpathcomponent:[nsstring stringwithformat:@ "idcard%zd", _ Selectindex]]; 1.0 ); [ImageData Writetofile:path Atomically:yes];
Read after the picture has been saved to the local
Nsarray *dirarray = nssearchpathfordirectoriesindomains (nscachesdirectory, Nsuserdomainmask, YES); *path = [Dirarray firstobject]; = [path stringbyappendingpathcomponent:[nsstring stringwithformat:@ "idcard%zd", I]] ; if ([[[Nsfilemanager Defaultmanager] Fileexistsatpath:path]) {*picdata = [NSData Datawithcontentsoffile:path]; = [UIImage imagewithdata:picdata]; }
Delete a picture that is stored locally
Nsarray *dirarray = nssearchpathfordirectoriesindomains (nscachesdirectory, Nsuserdomainmask, YES); *path = [Dirarray firstobject]; = [path stringbyappendingpathcomponent:[nsstring stringwithformat:@ "idcard%zd", I]] ; if ([[[Nsfilemanager Defaultmanager] Fileexistsatpath:path]) // If there is a configuration file for the temporary file {[ [Nsfilemanager Defaultmanager] removeitematpath:path error:nil]; }
Storage and reading and deletion of IOS pictures