2
我曾嘗試JSON.NET和MonoTouch的端口在https://github.com/ayoung/Newtonsoft.Json但得到這個序列化錯誤:JSON.NET:用MonoTouch的不工作「跑出2型蹦牀的」
Ran out of trampolines of type 2 in '/private/var/mobile/Applications/A901C3E6-D9AB-44AF-AA13-6B6E44467BAE/StaffRostering.app/mscorlib.dll' (128)
Stacktrace:
at Newtonsoft.Json.Serialization.DefaultContractResolver.GetParametrizedConstructor (System.Type) [0x00009] in /Users/vink/Dropbox/Ajilon Source/Apps/Utils/Newtonsoft.Json.MonoTouch/Newtonsoft.Json/Serialization/DefaultContractResolver.cs:336
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract (System.Type) [0x000ae] in /Users/vink/Dropbox/Ajilon Source/Apps/Utils/Newtonsoft.Json.MonoTouch/Newtonsoft.Json/Serialization/DefaultContractResolver.cs:310
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract (System.Type) [0x000b0] in /Users/vink/Dropbox/Ajilon Source/Apps/Utils/Newtonsoft.Json.MonoTouch/Newtonsoft.Json/Serialization/DefaultContractResolver.cs:675
at Newtonsoft.Json.Utilities.ThreadSafeStore`2.AddValue (TKey) <0x000bf>
at Newtonsoft.Json.Utilities.ThreadSafeStore`2.Get (TKey) <0x00173>
at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract (System.Type) [0x00011] in /Users/vink/Dropbox/Ajilon Source/Apps/Utils/Newtonsoft.Json.MonoTouch/Newtonsoft.Json/Serialization/DefaultContractResolver.cs:196
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.GetContractSafe (object) [0x00008] in /Users/vink/Dropbox/Ajilon Source/Apps/Utils/Newtonsoft.Json.MonoTouch/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs:86
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize (Newtonsoft.Json.JsonWriter,object) [0x00011] in /Users/vink/Dropbox/Ajilon Source/Apps/Utils/Newtonsoft.Json.MonoTouch/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs:70
at Newtonsoft.Json.JsonSerializer.SerializeInternal (Newtonsoft.Json.JsonWriter,object) [0x00012] in /Users/vink/Dropbox/Ajilon Source/Apps/Utils/Newtonsoft.Json.MonoTouch/Newtonsoft.Json/JsonSerializer.cs:451
at Newtonsoft.Json.JsonSerializer.Serialize (Newtonsoft.Json.JsonWriter,object) [0x00000]
我試過RestSharp。 MonoTouch的爲好,得到了類似的錯誤:
Ran out of trampolines of type 2 in '/private/var/mobile/Applications/A901C3E6-D9AB-44AF-AA13-6B6E44467BAE/StaffRostering.app/mscorlib.dll' (128)
Stacktrace:
at RestSharp.Reflection.SafeDictionary`2.GetEnumerator() <0x000ab>
at RestSharp.PocoJsonSerializerStrategy.TrySerializeUnknownTypes (object,object&) <IL 0x0002b, 0x00247>
at RestSharp.PocoJsonSerializerStrategy.SerializeNonPrimitiveObject (object,object&) <IL 0x00010, 0x000e7>
at RestSharp.SimpleJson.SerializeValue (RestSharp.IJsonSerializerStrategy,object,System.Text.StringBuilder) <IL 0x000f7, 0x00e1b>
at RestSharp.SimpleJson.SerializeObject (object,RestSharp.IJsonSerializerStrategy) <IL 0x0000e, 0x000eb>
at RestSharp.SimpleJson.SerializeObject (object) <IL 0x00006, 0x0008f>
at RestSharp.Serializers.JsonSerializer.Serialize (object) <IL 0x00001, 0x00083>
羅爾夫描述他們在幾個月前MonoTouch的郵件列表上@ http://monotouch.2284126.n4.nabble.com/Understanding-蹦牀的影響-td4495086.html – poupou 2012-08-03 12:58:45
謝謝。一旦我申請了這個,我就反彈了。很有彈性的解決方案。 – 2012-08-04 03:19:23