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