I can’t store any file in NSTemporaryDirectory subfolders
rootDirectoryName is GUID
subDirectoryName is also a GUID
self.rootFolderPath=[NSTemporaryDirectory() stringByAppendingString:rootDirectoryName];
self.currentFolder=[self.rootFolderPath stringByAppendingPathComponent:subDirectoryName];
NSURL* url =[NSURL URLWithString:[self.currentFolder stringByAppendingPathComponent:path]];
[data writeToURL:url atomically:YES];
NSFileManager *fileMgr = [NSFileManager defaultManager];
NSArray* paths=[fileMgr contentsOfDirectoryAtPath:self.currentFolder error:nil];
where path is also some GUID.jpg
I’m trying to save jpg data.
every time paths array is empty.
Before this i create a rootDirectoryName and subDirectoryName
Solved. Just replaced
[data writeToURL:url atomically:YES]to[data writeToFile:[url path] atomically:YES].