繁体   English   中英

UIApplication在此上下文中不存在错误Xamarin Forms升级到统一API

[英]UIApplication does not exist in this context error Xamarin Forms upgrade to unified API

我已经升级了Xamarin表单应用程序以使用新的统一API

我已经按照说明进行了一切,直到下面的代码没有更改为止一切顺利,并且自从上周我在开始时由项目模板生成代码以来,代码一直是相同的

using System;
using System.Collections.Generic;
using System.Linq;

namespace Newtest.iOS
{
    public class Application
    {
        // This is the main entry point of the application.
        static void Main (string[] args)
        {
            // if you want to use a different Application Delegate class from "AppDelegate"
            // you can specify it here.
            UIApplication.Main (args, null, "AppDelegate");
        }
    }
}

错误是:

UIApplication在此上下文中不存在。

我知道作为统一API的一部分有很多重命名,但是我看不到任何有关此错误的信息

我什至试图在更新后创建一个新的应用程序,以查看项目模板是否在我的IOS应用程序中为Main.cs生成了不同的代码,但没有

我可以从哪里获取更新的模板? 我正在使用Xamarin Studio。

在Unified API中, UIApplication在UIKit命名空间中。 您需要添加

using UIKit;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM