在 Xamarin 中的后台Under the hood in Xamarin.Mac

预先编译(AOT)Ahead of time compilation (AOT)

预先(AOT)编译是一种功能强大的优化技术,可提高启动性能。Ahead of time (AOT) compilation is a powerful optimization technique for improving startup performance. 但是,它还会以深远的方式影响生成时间、应用程序大小和程序执行情况,因此,有必要了解它的工作原理。However, it also affects your build time, application size, and program execution in profound ways, so it's worthwhile understanding how it works.

Mac 体系结构Mac architecture

Xamarin 与目标-C 的关系,包括编译、选择器、注册机构、应用程序启动和生成器等概念。Xamarin.Mac's relationship to Objective-C, including concepts such as compilation, selectors, registrars, app launch, and the generator.

Xamarin Mac 注册机构Xamarin.Mac registrar

Xamarin 将托管世界和 Cocoa 的运行时之间的差距桥梁,使托管类可以调用非托管的目标 C 类,并在发生事件时回调。Xamarin.Mac bridges the gap between the managed world and Cocoa's runtime, allowing managed classes to call unmanaged Objective-C classes and be called back when events occur. 执行这种 "神奇" 所需的工作由注册机构处理,但了解 "后台" 的情况有时会很有帮助。The work required to preform this “magic” is handled by the registrar, but understanding what's going on "under the hood" can sometimes be helpful.