COMMUNITY

Default function parameter giving wrong value on iOS with Air

air
ios

(Ruben) #1

Hello,

is anyone else seeing bugs with Haxe/OpenFL to Flash/Air target and then wrapping that up to an iOS (Objective C, not interpreter) build with Air through adt?

Default parameters seem to misbehave in the final .ipa. For example we have this function:

function mapView(viewClassOrName : Dynamic, mediatorClass : Class<Dynamic>, injectViewAs : Dynamic = null, autoCreate : Bool = true, autoRemove : Bool = true) : Void;

Calling it like this:

mediatorMap.mapView(PreloaderWeb, PreloaderMediator, PreloaderBase);

On iOS (and iOS only) the values for autoCreate and autoRemove are false. All other platforms work correctly.

I assume that the cause for this bug is somewhere in adt to compile the .swf to .ipa, but Adobe would probably not care to fix this… Any chance to find a workaround in Haxe?

My suspicion is that this is related to interfaces, both cases where we saw a bug like this in a function with default parameters where when the function was defined in an interface. However the same code in AS3 with interfaces does not produce the problem.

Any input is appreciated, thanks in advance!