problem with WWW

We use WWW objects all over the place and they’ve been working fine everywhere, but I have a specific instance that is causing me problems and I can’t seem to track down the cause. I have simplified the case as much as possible, and will try to give as much info as possible. We have a url, and we can use WWW to load it early on in the game, but when I try and load it later it crashes. I am calling it later on in the game through a button press that calls the function that tries to load the WWW. I load it with the following code.

WWW www = new WWW (URL);
yield return www;

This crashes on every device I run it on in my function called from a button press(I’ve called it from a delegate, from a function added to the on touch, and from a function called by the delegate). I always startcouroutine on the outer function.

If I change the above code to

WWW www = new WWW(URL);
while(www.isDone == false)
{
yield return new WaitForSeconds(.05f);
}

it get’s past that function without error(and isDone is true on the other side) in the unity editor but crashes on the iphone. Any suggestions of where to look would be greatly appreciated.

You sure that you are using this code inside an IEnumerator?

Yes.

So I’ve done more experimentation and it’s crashing on ANY yield return, still not sure why because we use those plenty of other places.

anything special about the URL?

What does GDB say callstack wise etc when you run it as debug build