简体   繁体   中英

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 ?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM