Search code examples
iphoneobjective-ciosnsstringstringwithformat

Strange BAD_EXC_ACCESS when declaring a string


Okay, all I am doing is setting an NSString to a value with this code:

NSString *stringURL = [NSString stringWithFormat:@"http://api.themoviedb.org/3/movie/%@/trailers?api_key=1523229ded5824dab8bb7840782db266",searchID];

This is a string that I then turning into a URL for querying the TMDB database. This line of code gives me a BAD_EXC_ACCESS and it is blowing my mind because using this sort of NSString construction is something I have done thousands of times without a problem.

The one other thing to note is that this line is being executed right after another query call is made. The weird thing is that call makes the stringURL the same way, yet it works fine.

Any help would be appreciated...


Solution

  • You need to use %i to log an NSInteger, not %@