testing testing - 4 months ago 90
iOS Question

Xamarin.iOS: NSTemporaryDirectory()

Is

available for Xamarin.iOS? I can't find something in the Xamarin API. How is it related to described directories here?

Answer

You can use the normal GetTempPath method to obtain the file path:

var temp = System.IO.Path.GetTempPath();
Console.WriteLine(temp);

Or if you need a NSUrl:

var nsURL = NSFileManager.DefaultManager.GetTemporaryDirectory();
Console.WriteLine(nsURL.AbsoluteUrl);

The NSUrl absolute url is the same path, just prefixed with file://