如何解决在 Xamarin Forms 应用程序中构建路径 iOS v MacOs 的问题
我有这个代码:
count = df.groupby(['airline','negativereason']).size()
print(count)
>airline negativereason
>American Bad Flight 87
> Can't Tell 198
> Cancelled Flight 246
> Customer Service Issue 768
> Damaged Luggage 12
> Flight Attendant Complaints 87
> Flight Booking Problems 130
> Late Flight 249
> Lost Luggage 149
> longlines 34
>Delta Bad Flight 64
> Can't Tell 186
> Cancelled Flight 51
> Customer Service Issue 199
> Damaged Luggage 11
> Flight Attendant Complaints 60
> Flight Booking Problems 44
> Late Flight 269
> Lost Luggage 57
> longlines 14
在 Mac 上它按预期运行。但是在 iOS 模拟器上(我刚开始使用)它引发了一个异常:
System.IO.DirectoryNotFoundException: 找不到部分 小路 '/Users/xxxxxxx/Library/Developer/CoreSimulator/Devices/B812608B-8131-4386-B189-C646684A8965/data/Containers/Data/Application/EF23B73D-8D38-4F41-995E-FCOS3AEits3Roy .
我应该如何在我的 iOS 版本上复制测试?如果我使用文字路径而不是 <style>
#php_messages {
position: fixed;
left: 0;
top: 0;
z-index: 9999;
}
.php_message {
background-color: #333;
border: red solid 1px;
color: white;
font-family: "Courier New",Courier,monospace;
margin: 1em;
padding: 1em;
}
</style>
<div id="php_messages"></div>
<?php
function custom_message($output) {
echo
'
<script>
var
el = document.createElement("DIV");
el.classList.add("php_message");
el.innerHTML = \''.$output.'\';
document.getElementById("php_messages").appendChild(el);
</script>
';
}
?>
等。我没有问题。
解决方法
我能够解决这个问题。我与资源相关的 question / answer 有所帮助。
在对这个问题的评论中,我被问到:
这些文件是如何与您的应用一起部署的?
这是关键!
我向 AppDelegate 类添加了一个构造函数:
[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
public AppDelegate()
{
InstallApplicationFiles();
}
链接的问答有更多信息。通过让应用从资源中复制默认文件,iOS 模拟器的路径问题得到解决。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。