How to find why NSMutableData is invalid

Posted by 4thSpace on Stack Overflow See other posts from Stack Overflow or by 4thSpace
Published on 2010-03-14T23:08:27Z Indexed on 2010/03/14 23:15 UTC
Read the original article Hit count: 238

I access a RESTFUL url and get back results. The results are in JSON. I turn the response into a string via:

- (void)connectionDidFinishLoading:(NSURLConnection   *)connection {
NSString *json = [[NSString alloc] initWithBytes:[self.receivedData mutableBytes] length:[self.receivedData length] encoding:NSUTF8StringEncoding];

The json variable has a value of 0x0. When I mouse over it, I see <Invalid CFStringRef>. How can I debug this to tell why it is invalid? I render the JSON given back through the browser in A JSON parser. That checks out fine.

Results are given back by entering an ID in the URL. Other IDs return results without issue. The result set is fairly large.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk