编辑:
@H_403_2@几年后,事情变得更容易了.现在可以省略
Register()属性,在应用程序和应用程序委托上,而是使用: @H_403_2@UIApplication.Main(args,typeof(CustomApp),typeof(CustomAppDelegate)); @H_403_2@为了能够覆盖UIApplication.SendEvent(),我想要子类化UIApplication:
Register()属性,在应用程序和应用程序委托上,而是使用: @H_403_2@UIApplication.Main(args,typeof(CustomApp),typeof(CustomAppDelegate)); @H_403_2@为了能够覆盖UIApplication.SendEvent(),我想要子类化UIApplication:
public class UIApplicationMain : UIApplication { public UIApplicationMain () : base() { } public override void SendEvent (UIEvent uievent) { base.SendEvent (uievent); } }@H_403_2@在main.cs中我使用以下代码:
public class Application { static void Main (string[] args) { UIApplication.Main (args,"UIApplicationMain","AppDelegateBase"); } }@H_403_2@但它失败了:
@H_403_2@06002 @H_403_2@NSInternalInconsistencyException Reason: Unable to instantiate the@H_403_2@所以我猜错了一些属性.但是在哪里和哪里?
UIApplication subclass instance. No class named UIApplicationMain is
loaded.