Closed rewb0rn closed 6 years ago
Hi, This fix is really strange. Only unsafe cast works??? This must not have any side effects on other targets. You can send a PR. But this is really odd.
So far, only getBool seems to be affected. getInt() etc. seem to work fine. As I said, there are sometimes very strange bugs on iOS. I did some debugging and it's even stranger:
var val:Bool = cast(wrapper.data,Bool);
trace(this, val);
return val;
Then the trace outputs the correct value (true or false), but the function still returns null. So probably there is a weird problem returning or casting Bool
to Null<Bool>
on iOS.
Anyway I will create the pull request.
Merged. Thank you
Hello,
when compiling the library with Air for iOS (Objective C, not interpreter), the function SFSArray::getBool is always returning null at the moment.
This is the original line that causes a problem:
return(wrapper != null ?cast(wrapper.data,Bool):null);
I was testing a bit and this is the easiest way to fix it:
return(wrapper != null ?cast(wrapper.data):null);
I can prepare a pull request, do you have any concerns or another preferred fix?
Just a sidenote: iOS with Air builds have some of these mystery bugs from time to time, due to the fact that the compilation works differently on the platform (no AVM). We have seen some rare and strange issues in AS3 code on iOS as well, before we started using Haxe.