3
« on: March 13, 2014, 03:33:48 AM »
Hi,
We've fund a bug in NGUI 3.5.3 that wasn't present in older versions, and it doesn't seem to be fixed in 3.5.4.
The program will crash on iOS if you create an UIButton that opens a native iOS view in its OnClick() method. We've tested this with the native Tweet Composer, the Twitter SDK's login view and GameCenter's achievements view. Any view will probably do.
The crash happens in UICamera on line 1478:
Notify(currentTouch.pressed, "OnClick", null);
if (currentTouch.clickTime + 0.35f > time)
With this exception:
NullReferenceException: A null value was found where an object instance was required.
at UICamera.ProcessTouch (Boolean pressed, Boolean unpressed) [0x00559] in
Assets/NGUI/Scripts/UI/UICamera.cs:1478
The currentTouch is probably invalid after a new view has been opened. Is it set to null in OnApplicationPause() maybe?
Our current workaround is to remember the click and delay the opening of the view until the next frame when there're no touches left on screen.
We're using Unity 4.3.4 and tested this with XCode 5.0 and 5.1.
Email me if you want a small test project that reproduces the problem.
Any help is very much appreciated. Thanks.