在 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 的執行時間之間的差距,讓 managed 類別能夠呼叫非受控的目標 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.