iOS: Odd stringByAddingPercentEscapesUsingEncoding issue
===

Two questions for today!

In my search app I start off in the search method with this line:

        myQuery = [searchBar.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

And then I move onto the rest of the method. The issue is for some reason it won't let me make searches of multiple words on either the simulator or an actual iPhone. 

So if I write it like this:

    theQuery = searchBar.text;
        [myQuery stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

It'll allow for multiple word searches, but on the real iPhone the string becomes null, somehow. On the simulator it works fine, but on the real phone it doesn't.

So first question is can anyone see something wrong here? Secondly, is there a much better way to do this?

Thanks