- Home /
Unautherorized Access Excepetion on iOS8
I'm working on a game that has been running fine, the build target has been iOS7.0, the device has been running iOS7.1.2. But now that this has been upgraded to iOS8 I'm getting a System.UnautherorizedAccessExcepetion.
Unhandled Exception: System.UnauthorizedAccessException: Access to the path "/private/var/mobile/Containers/Bundle/Application/17F7BB49-5EEF-4BD2-9805-12808C6F5049/Documents" is denied.
This exception happens after trying to create a save game folder within iOSDocumentsPath.
This is not an area of the code I have changed recently. So I think something has changed around. The binary has been rejected by Apple after crashing while running iOS8. Does anyone have an idea how to fix this?
public static string iOSDocumentsPath {
get {
string path = Application.dataPath.Substring(0, Application.dataPath.Length - 5);
path = path.Substring(0, path.LastIndexOf('/'));
return path + "/Documents";
}
}
Just to clear up what iOS documents path is doing.
Answer by Culzean · Sep 19, 2014 at 03:18 PM
No matter,
used this instead. Working more reliably.
System.Environment.GetFolderPath( System.Environment.SpecialFolder.Personal );
Your answer
![](https://koobas.hobune.stream/wayback/20220613163323im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Problem on writing the copied array of string on text pad 2 Answers
Can you monitor or profile file I/O from within Unity? 0 Answers
How do I look at a file generated by my own app on the iphone using xcode 0 Answers
What to do about a Pixel crushers dialogue template file screw up? 0 Answers
Write to file in Xcode 1 Answer