Bug 11501 - UISwitch - unrecognized selector sent to instance when set OnImage/OffImage
Summary: UISwitch - unrecognized selector sent to instance when set OnImage/OffImage
Status: RESOLVED INVALID
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 6.2.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-04-01 10:53 UTC by Maxim
Modified: 2013-04-03 03:02 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Maxim 2013-04-01 10:53:54 UTC
Code:
    var a = new UISwitch();
    a.OnImage = new UIImage();

Stacktrace:
MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown.  Name: NSInvalidArgumentException Reason: -[UISwitch setOnImage:]: unrecognized selector sent to instance 0xf5d5440
  at at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging:void_objc_msgSend_IntPtr (intptr,intptr,intptr)
  at MonoTouch.UIKit.UISwitch.set_OnImage (MonoTouch.UIKit.UIImage value) [0x00021] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UISwitch.g.cs:278
  at Moments.Views.Autorize.SplashView.ViewDidAppear (Boolean animated) [0x00006] in /Users/mobile/Projects/msn/msn_client/Moments/Views/Autorize/SplashView.cs:74
  at at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38
  at Moments.Application.Main (System.String[] args) [0x00000] in /Users/mobile/Projects/msn/msn_client/Moments/Main.cs:17
Comment 1 Rolf Bjarne Kvinge [MSFT] 2013-04-01 17:42:03 UTC
OnImage is only available in iOS 6.0 or later - which version are you running on?
Comment 2 Maxim 2013-04-03 03:02:59 UTC
My (colleague) bad. Thank you. It was iOS 5.