What is Selector in Xamarin.iOS?
What is Selector in Xamarin.iOS?
In Xamarin.iOS, a Selector is a class that represents an Objective-C selector in managed code. It is part of the ObjCRuntime namespace and is used to interact with Objective-C methods from C# code. The Selector class allows developers to create and manage selectors, which are essentially pointers to method names in Objective-C.
Selector Class:Creation:
Selector(IntPtr): Creates a selector from an unmanaged pointer to the Objective-C selector.Selector(String): Creates a new selector and registers it with the Objective-C runtime.Properties:
Handle: A pointer to the unmanaged selector representation.Name: The name of the selector.Methods:
Equals(Object): Compares two objects for equality.Equals(Selector): Compares two selectors for equality.FromHandle(IntPtr): Creates a managed selector wrapper based on the native handle.GetHandle(String): Returns the handle to the specified Objective-C selector.GetHashCode(): Returns the selector's hash code.Register(IntPtr): Creates a new selector instance for the specified Objective-C selector.Đăng nhập để tham gia thảo luận cùng mọi người.
Chưa có bình luận nào
Hãy là người đầu tiên chia sẻ suy nghĩ của bạn.