Webサービスからイメージをダウンロードしました。イメージをSafari内で開くか、カメラロールに保存する必要があります。私はSafariで画像を開こうとしましたが、Safariは開かれません。イメージ付きのSafariの起動またはカメラロールへの保存
var safari = UIApplication.SharedApplication;
var uri = new NSUrl(path); // where the image is saved to
safari.OpenUrl(uri);
これはコンパイルが、Safariは
カメラロールへの保存のための私が持っているコードが正しいアクセス権が設定されているがクラッシュし、やけど(この
PHPhotoLibrary.SharedPhotoLibrary.PerformChanges(() =>
{
using (var pool3 = new NSAutoreleasePool())
{ pool3.InvokeOnMainThread(delegate()
{ PHAssetChangeRequest.FromImage((UIImage)UIImage.FromFile(path));
});
}
}, (t, err) =>
{
if (!t)
{
using (var pool1 = new NSAutoreleasePool())
{
pool1.InvokeOnMainThread(delegate() {
var alert = new UIAlertView("Error saving file", "An error has occured saving your photo to the camera roll", null, "OK");
alert.Show();
};
}
else
{
using (var pool2 = new NSAutoreleasePool())
{
pool2.InvokeOnMainThread(delegate(){
var alert = new UIAlertView("Image saved", "Your image has been saved to the camera roll", null, "OK");
alert.Show();
});
};
}
});
ですが起動しません。 )
私はこれらのどちらも正しいとは思わないので、なぜ迷っていますか?