What is the correct way to get the iOS library folder using Xamarin.iOS?

This will give me my iOS application document root:

Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) 

Is there something similar to get into the Library folder?

+6
source share
2 answers
 var docsPath = Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments); var libPath = Path.Combine (docsPath, "..", "Library"); 
+10
source

In iOS8, I used this and it worked:

 NSFileManager.DefaultManager.GetUrls (NSSearchPathDirectory.LibraryDirectory, NSSearchPathDomain.User) [0].Path 

I got this on the Xamarin iOS file system page. It says: "iOS 8 NOTE: portions of this document are affected by changes in iOS 8. If your application uses Environment.SpecialFolder or calculates relative paths such as" .. / Documents ", you should read this technical note from Apple. Available at the Basics of the iOS File System. "

+4
source

All Articles