title: SBJson and NSData
body: <p>I'm getting data from quizlet.com and it works OK for simple code:</p>
  
  <pre><code>-(void) grabbQuizletWithUrl:(NSURL*)requstURL {
  
       NSString *dataString = [NSString stringWithContentsOfURL:requestURL encoding:NSUTF8StringEncoding error:&amp;error]; 
  
       NSDictionary *dict = [dataString JSONValue];
  }
  </code></pre>
  
  <p>But I need to use NSURLConnection to start and stop activity indicator. I'm trying </p>
  
  <pre><code>-(void) grabbQuizletWithUrl:(NSURL*)requstURL {
  
      NSURLRequest *quizletRequest = [[NSURLRequest alloc] initWithURL:requestURL];
      NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:quizletRequest
                                                            delegate:self];
      [connection release];
      [quizletRequest release];
  
  }
  
  // and getting data in delegate method:
  
  
  
  - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
  
      [self.activityIndicator stopAnimating];
  
      NSString *dataString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
  
      NSDictionary *dict = [dataString JSONValue];
  
  }
  </code></pre>
  
  <p>I'm getting messages like these:</p>
  
  <p>[2377:707] -JSONValue failed. Error is: Unexpected end of input</p>
  
  <p>[2377:707] -JSONValue failed. Error is: Illegal start of token [.]</p>
  
  <p>[2377:707] -JSONValue failed. Error is: Illegal start of token [d]</p>