【问题标题】:UIApplication does not exist in this context error Xamarin Forms upgrade to unified APIUIApplication does not exist in this context 错误 Xamarin Forms upgrade to unity API
【发布时间】:2015-11-10 02:41:08
【问题描述】:

我已升级我的 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。

【问题讨论】:

    标签: c# ios xamarin


    【解决方案1】:

    在统一 API 中,UIApplication 位于 UIKit 命名空间中。你需要添加

    using UIKit;
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-12-20
    • 1970-01-01
    • 1970-01-01
    • 2016-09-03
    • 2020-09-12
    • 1970-01-01
    • 2020-05-27
    • 1970-01-01
    相关资源
    最近更新 更多