- Home /
Directory.createDirectory creates files instead of directory in iOS
I have to save some data locally on iOS device for an Unity Game. Unity provide
Application.persistentDataPath
to get public directory to save data. And printing it on console shows that this path returned for iOS is correct i.e. /Users/naeemiqbal/Library/Developer/CoreSimulator/Devices/----/data/Containers/Data/Application/----/Documents/
So one function returns the path and other check if directory exists, if not it should create an directory but it creates FILE without any extension. Here si my code
void savePose(Pose pose){
if (!Directory.Exists(PoseManager.poseDirectoryPath())){
Directory.CreateDirectory(PoseManager.poseDirectoryPath());
//Above line creates a file
//by the name of "SavedPoses" without any extension
}
}
static string poseDirectoryPath() {
return Path.Combine(Application.persistentDataPath,"SavedPoses");
}
Your answer
Follow this Question
Related Questions
Spotlight Does Not Show Up on iPhone5c (works on iPhone 4s/6 iPad mini/air and Galaxy S4) 0 Answers
Meshes not being rendered on iPhone 5, but working on any other iOS device 0 Answers
How to solve notch problem and safe area in iphoneX (unity build to ios) 0 Answers
How do you create a subfolder inside persistentDataPath in iOS? 0 Answers
Javascript command for taking a screenshot then saving it to a folder directory?? 3 Answers