【发布时间】:2020-06-15 13:29:07
【问题描述】:
我想在 iOS 上使用 DataTable 类。正如您在代码中看到的那样,我正在实现 DataTable 类。它在 Android 和使用 Unity 的独立版本上运行良好。我无法弄清楚为什么 iOS 无法正常工作。有趣的部分是这个应用程序的早期版本在所有平台上都能正常工作。有什么想法可以解决这个问题吗?我检查了 Xcode 上的构建文件夹,并在资源文件夹中看到了 System.Data.dll,因此没有优化剥离所有必要的文件。
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 时,我看到第一条调试日志消息,然后抛出此异常。
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)
任何帮助将不胜感激。
【问题讨论】:
-
所以问题似乎是
ColumnName = ...可能与When a DataColumn is created, it has no ColumnName value. However, when the DataColumn is added to a DataColumnCollection for a DataTable object, it is given a default name ("Column1", "Column2", and so on).相关(来自DataColumn) -
是的,看起来三是关于列名的问题,但这没有任何意义。我也尝试了不同的名字:) 没有任何变化。
-
我将尝试将该列添加到 DataColumnCollection 然后给它一个名称。我会写结果。
-
当我尝试将列添加到集合中时,设置列名会引发相同的异常。
标签: ios unity3d system.data notsupportedexception