System.Data在iOS Unity Build上引发NotSupportedException [英] System.Data throws NotSupportedException on iOS Unity Build

查看:361
本文介绍了System.Data在iOS Unity Build上引发NotSupportedException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在iOS上使用DataTable类.如您在代码中看到的,我正在实现DataTable类.它在Android和使用Unity的独立版本上均能正常工作.我无法弄清楚为什么iOS无法正常运行.有趣的是,此应用程序的早期版本在所有平台上均可正常运行.有什么想法可以深入探讨这个问题吗?我检查了Xcode上的build文件夹,然后在resources文件夹上看到了System.Data.dll,因此没有优化,剥离了所有必需的文件.

I want to use DataTable class on iOS. I am implementing DataTable class as you see in the code. It works fine on Android and Standalone builds with Unity. I cannot figure it out why iOS is not woking. The interesting part is the early version of this app works fine on all platforms. Is there any idea how to dig in to the issue? I check the build folder on Xcode and I see the System.Data.dll on the resources folder so the is no optimization stripped all necessary files are included.

DataTable dataTable = new DataTable("Example Table Name");

    DataColumn column;
    DataRow row;
    Debug.Log("Datarow and column created");
    // Create new DataColumn, set DataType, 
    // ColumnName and add to DataTable.
    column = new DataColumn
    {
        DataType = Type.GetType("System.String"),
        ColumnName = "foo",
        ReadOnly = false,
        Unique = false
    };
    Debug.Log("First column created");
    dataTable.Columns.Add(column);

当我在控制台上的iOS上构建时,我看到第一条调试日志消息,然后抛出此异常.

When i build on iOS on console i see the first debug log message then throw this exception.

    Log: NotSupportedException: linked away Stack: System.Data.DataCommonEventSource.ExitScope (System.Int64 scopeId) (at <00000000000000000000000000000000>:0)
System.Data.DataColumn.set_ColumnName (System.String value) (at <00000000000000000000000000000000>:0)
GenelSatisUIController.CreateTable () (at <00000000000000000000000000000000>:0)
GenelSatisUIController.AdHeaderAndValues () (at <00000000000000000000000000000000>:0)
GenelSatisUIController+<GenelSatiRaporTable>d__7.MoveNext () (at <00000000000000000000000000000000>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <00000000000000000000000000000000>:0)

任何帮助将不胜感激.

推荐答案

我不完全理解为什么,但是当我更改这样的实现时,效果很好.也许会帮助别人.

I do not fully understand why but when i changed the implementation like this it works fine. May be it will help somebody.

 DataTable dataTable = new DataTable("Genel Satış Raporu");

    DataColumn column;
    DataRow row;
    Debug.Log("Datarow and column created");
    // Create new DataColumn, set DataType, 
    // ColumnName and add to DataTable.

    column = new DataColumn("Grup Adı", Type.GetType("System.String"));

    dataTable.Columns.Add(column);

    column = new DataColumn("Adet", Type.GetType("System.String"));

    dataTable.Columns.Add(column);

    column = new DataColumn("Tutar", Type.GetType("System.Double"));

    dataTable.Columns.Add(column);

这篇关于System.Data在iOS Unity Build上引发NotSupportedException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆