Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin.iOS: NSTemporaryDirectory()

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

like image 681
testing Avatar asked Dec 04 '25 17:12

testing


1 Answers

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://

like image 160
SushiHangover Avatar answered Dec 06 '25 09:12

SushiHangover