c# - PCLStorage FileSystem is only available in Android, not iOS -
i'm writing cross platform application in xamarin, android , ios, , need save text files local storage. i'm using pclstorage, whenever mouse on pclstorage code, says "myapplication.android: available, myapplication.ios not available". how can use pclstorage store files on both platforms? or there way can this? here's example of of code:
public async task createrealfileasync(string filename, string filebody) { // hold of file system ifolder rootfolder = filesystem.current.localstorage; // create folder, if 1 not exist ifolder folder = await rootfolder.createfolderasync("dadappfiles", creationcollisionoption.openifexists); // create file, overwriting existing file ifile file = await folder.createfileasync(filename, creationcollisionoption.replaceexisting); // populate file text await file.writealltextasync(filebody); }
Comments
Post a Comment