本文整理汇总了C#中MonoMac.Foundation.NSObject.RespondsToSelector方法的典型用法代码示例。如果您正苦于以下问题:C# NSObject.RespondsToSelector方法的具体用法?C# NSObject.RespondsToSelector怎么用?C# NSObject.RespondsToSelector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoMac.Foundation.NSObject
的用法示例。
在下文中一共展示了NSObject.RespondsToSelector方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckNSObjectProtocol
protected virtual void CheckNSObjectProtocol(NSObject obj)
{
// not documented to allow null, but commonly used this way. OTOH it's not clear what code answer this
// (it might be different implementations) but we can make sure that Apple allows null with this test
// ref: https://bugzilla.xamarin.com/show_bug.cgi?id=35924
var kind_of_null = obj.IsKindOfClass (null);
if (kind_of_null)
ReportError ("{0} : IsKindOfClass(null) failed", instance_type_name);
var is_member_of_null = obj.IsMemberOfClass (null);
if (is_member_of_null)
ReportError ("{0} : IsMemberOfClass(null) failed", instance_type_name);
var respond_to_null = obj.RespondsToSelector (null);
if (respond_to_null)
ReportError ("{0} : RespondToSelector(null) failed", instance_type_name);
var conforms_to_null = obj.ConformsToProtocol (IntPtr.Zero);
if (conforms_to_null)
ReportError ("{0} : ConformsToProtocol(null) failed", instance_type_name);
}