Bug 10720 - Subclassing types created with btouch fails on the simulator
Summary: Subclassing types created with btouch fails on the simulator
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 6.0.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2013-02-27 04:20 UTC by Stephane Delcroix
Modified: 2013-02-27 07:09 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 FIXED

Description Stephane Delcroix 2013-02-27 04:20:50 UTC
As suggested by @spouliot, I open a bug for this stackoverflow issue: http://stackoverflow.com/questions/14962741/subclassing-bound-type-in-mono-touch

With the cocos2d binding that Miguel and I created, if you subclass a CCSprite, it fails on the simulator, but works fine on devices.

There's a sample for reproducing this there https://github.com/StephaneDelcroix/mt-subclassbug

The generated bindings use different code path for setting some properties depending on the environment.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2013-02-27 05:33:45 UTC
I can reproduce this, and I already have code that (unintentionally) fixes it.

Now I just need to find out where the problem is.
Comment 2 Rolf Bjarne Kvinge [MSFT] 2013-02-27 06:05:50 UTC
In fact this seems to be a problem with the bindings. I can't reproduce with the latest bindings from monotouch-bindings, I get a ArgumentNullException which is fixed with this: https://gist.github.com/rolfbjarne/2cbe6db38c40b9322f32
Comment 3 Stephane Delcroix 2013-02-27 07:00:58 UTC
The main difference between my sample and today's mono touch-binding, is the use of the new 2.1rc0a bugfix release in lieu of 2.1rc0

this part of the ChangeLog might be interesting:
. [FIX] RGBAProtocol: color and opacity are propagated if parent has cascade property enabled
		renamed methods: cascadeColor -> cascadeColorEnabled, cascadeOpacity -> cascadeOpacityEnabled
. [FIX] Sprite: color code improved. Removed 'unmodifiedColor' ivar.
Comment 4 Stephane Delcroix 2013-02-27 07:09:55 UTC
I tested again with the main branch and indeed the bug is fixed. Thanks Rolf. I'm sending a pull request to fix the ApiDefinition https://github.com/mono/monotouch-bindings/pull/97