NSTemporaryDirectory subdirectories

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].

Need Your Help

C++ boost:asio what happens to server class when session class is deleted

c++ asynchronous boost boost-asio

This is my first boost::asio project and I came up with a code structure that has one server that create several sessions based on connection requests.

ASPxGridView error with checkbox

c# asp.net .net aspxgridview

I have one grid with checkbox. Sometimes, when select row and click ADD button it's not work and debugger show me that haven't selected row.