PlayerLoop called recursively! Help me pls..

When I try to call the native function from the unity, my application frozen and spamming error “PlayerLoop called recursively!” in xCode Console. I’m use unity 3…4.1.

Does anyone know a solution to this problem?

anyone?

It’s usually caused on iOS by adding a UIView with a UIViewController to the main UIWindow, though other things can do it as well. The solution is to do the same action on a delay, using something like NSObject’s performSelector call, like:

[self performSelector:@selector(methodWhereYouAddYourUIStuff) withObject:nil afterDelay:0.1]

There’s more info on the issue here (in the iOS section):

http://unity3d.com/support/documentation/Manual/TroubleShooting.html

However, there is another BIG problem that can cause this, and that is certain new API’s in the 3.5 release coded by Unity have the exact same issue, and there’s no way for you to fix it. If you use the new ADBannerView class, for example, you’re going to have the problem on some devices (that’s a class Unity created which wraps iAd on iOS). So there are built-in Unity calls on iOS that you can’t use at all. I’ve been meaning to post this to the preview forum, but I really dont’ think any Unity devs pay attention to it.

Complicating the issue is that this loop problem will happen only on certain device/iOS combinations and not others, so it’s difficult to know whether you’re going to have it or not, depending on just how many different device/iOS flavors you have available for your testing.

HTH,
Sean