The insistence of the UIKit base classes on throwing this exception makes it difficult to write decorator style classes that work reliably.
Take, for example, an attempt to write a UITableViewSource that wraps another UITableViewSource and supplements its behavior in some fashion. The wrapper needs to override all relevant methods and forward them onto the inner source. If the inner source has not overridden the method, an exception is thrown. The wrapper is forced to use RespondsToSelector to ascertain whether it is safe to make the call to the inner instance. This is onerous.
Moreover, the adapter know has a conundrum: if the inner instance does not respond to the selector, what should it do in the case where a return value is expected? It can only return default(TReturnType).
What is the advantage to the base UIKit classes throwing this exception rather than just ignoring the request or returning default(TReturnType)? Is there some way this could be made easier?
I have checked this issue and able to reproduce the reported behaviour. To reproduce this issue I have followed the steps mentioned below.
1. Create a simple iOS app (Single View).
2. Implement the below code in method 'FinishedLaunching'.
>var x = base.AccessibilityPerformMagicTap ();
3. Run the app and got the issue.
Screencast : http://www.screencast.com/t/4ovKDgm5f
Error Log : https://gist.github.com/Udham1/a75688fbe9159320af7d
Application output : https://gist.github.com/Udham1/d4a461daccc3ac9a7e73
Ide Log : https://gist.github.com/Udham1/1a20a1fcc9726534b8bf
Environment Info :
=== Xamarin Studio ===
Version 5.9.2 (build 2)
Installation UUID: ce927b2a-2c07-44c5-b186-09cfdafba6dc
Mono 4.0.1 ((detached/11b5830)
GTK+ 2.24.23 (Raleigh theme)
Package version: 400010043
=== Apple Developer Tools ===
Xcode 6.2 (6776)
=== Xamarin.iOS ===
Version: 184.108.40.206 (Enterprise Edition)
Build date: 2015-05-20 21:56:40-0400
=== Build Information ===
Release ID: 509020002
Git revision: 43735a4b905b571f69cf9428a3ea7b52aef55476
Build date: 2015-05-18 09:38:12-04
Xamarin addins: ab18ddff45f507ed74f36c2b65df9aee22e28a56
=== Operating System ===
Mac OS X 10.9.5
Darwin Xamarin76s-Mac-mini.local 13.4.0 Darwin Kernel Version 13.4.0
Sun Aug 17 19:50:11 PDT 2014