【Unity3D游戏开发】System.Collections.Generic.ICollection`1.CopyTo 错误 (二三)

来源:互联网 发布:分页查询sql语句 编辑:程序博客网 时间:2024/06/04 19:32

使用Unity,编辑器模式没有问题,iOS上报错误

System.Collections.Generic.ICollection`1.CopyTo


错误位置:

string[] receipts = PlayerPrefsEx.GetStringArray("unfinished_iap_receipt");List<string> unFinIAPReceipts = new List<string>(receipts);

出错原因:

Most of Linq extension methods from Linq for Collections are not working with IEnumerables on iOS since they require AOT runtime compiler which is not supported.However there is a Linq for iOS library on Asset Store that is similar to Linq but doesn't require a runtime compiler. So you can use it on iOS and ToArray() method will work with this library.


iOS真机上对使用C#的Linq有限制 


List<string> ls = new List<string>(receipts);



解决办法:

使用for循环赋值吧,虽然麻烦了点

0 0
原创粉丝点击