我有最新的 Xamarin.iOS 测试版;尝试使用任何异步方法都会触发 JIT 异常。无论方法的内容如何,都会发生。
我正在运行它的控制器(主要是为了令牌异步方法而删除)
using System;
using System.Drawing;
using System.Net.Http;
using MonoTouch.Foundation;
using System.Collections.Generic;
using MonoTouch.UIKit;
using Archer.Base;
namespace Archer.Ios
{
public class CategoryTableViewController : UITableViewController
{
public CategoryTableViewController () : base (UITableViewStyle.Grouped)
{
}
String foo;
public override void DidReceiveMemoryWarning ()
{
// Releases the view if it doesn't have a superview.
base.DidReceiveMemoryWarning ();
// Release any cached data, images, etc that aren't in use.
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
//*snip*
}
public override void ViewDidAppear (bool animated)
{
LoadCategories ();
base.ViewDidAppear (animated);
}
public async void LoadCategories ()
{
foo = await (new HttpClient ()).GetStringAsync
("http://ifconfig.me/all.json");
}
}
}
System.ExecutionEngineException:在使用 --aot-only 运行时尝试 JIT 编译方法“System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start (Archer.Ios.CategoryTableViewController/c__async0&)”。有关详细信息,请参阅http://docs.xamarin.com/ios/about/limitations。
在 Archer.Ios.CategoryTableViewController.LoadCategories () [0x00000] 在:0 在 Archer.Ios.CategoryTableViewController.ViewDidLoad () [0x0009d] 在 /Users/apaulin/src/Archer/Archer.Ios/CategoryTableViewController.cs:43 在 at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging:void_objc_msgSend (intptr,intptr) at MonoTouch.UIKit.UIWindow.MakeKeyAndVisible () [0x00008] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIWindow.g .cs:129 在 Archer.Ios.AppDelegate.FinishedLaunching (MonoTouch.UIKit.UIApplication 应用程序,MonoTouch.Foundation.NSDictionary 选项)[0x00054] 在 /Users/apaulin/src/Archer/Archer.Ios/AppDelegate.cs:39 在在 MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr) 在 MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38 at Archer.Ios.Application.Main (System.String[] args) [0x00001] in /Users/apaulin/src/Archer/Archer.Ios/Main.cs:17