XCode, widok tabeli cellForRowAtIndexPath

Wiem, że istnieje proste rozwiązanie tego problemu, ale nie mogę powiedzieć: /

cell.textLabel.text = [BooksBorrowed objectAtIndex:0];

Mam w mojej metodzie cellForRowAtIndexPath, że bookName jest ciągiem znaków. Zawiesza się i nie pozostawia błędu w dzienniku. Nie wiem, co robię źle.

bookName to ciąg, który otrzymuję od JSON Parsing i ma zawartość.

(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath   *)indexPath
 {
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault   reuseIdentifier:CellIdentifier] autorelease];
    }

    NSLog(@"Book Name is %@", BooksBorrowed[0]);
    cell.textLabel.text = [BooksBorrowed objectAtIndex:0];

    return cell;
  }

W ten sposób otrzymuję tablicę BooksBorrowed:

 - (void)updateMyBooks
  {
        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        // Fetch data on a background thread:
        NSString *authFormatString =
        @"http://localhost:8888/Jineel_lib/bookBorrowed.php?uid=%d";

        NSString *urlString = [NSString stringWithFormat:authFormatString, 1];

        NSURL *url = [NSURL URLWithString:urlString];

        NSString *contents = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil];

        response1 = [contents JSONValue];

        if (contents) {
          NSMutableArray *newBooksBorrowed = [NSMutableArray array];

          // ... Parse JSON response and add objects to newBooksBorrowed ...
          BookName = [[NSString alloc]init];
          DateBorrowed = [[NSString alloc]init];
          BookID = [[NSString alloc]init];
          BookExtended = [[NSString alloc]init];
          BookReturned = [[NSString alloc]init];

          BookName = [response1 valueForKey:@"BookName"];
          BookID = [response1 valueForKey:@"BookID"];
          DateBorrowed = [response1 valueForKey:@"DateBorrowed"];
          BookExtended = [response1 valueForKey:@"Extended"];
          BookReturned = [response1 valueForKey:@"Returned"];
          NSLog(@"Book Name is %@", BookName);

          [newBooksBorrowed addObject:BookName];

          dispatch_sync(dispatch_get_main_queue(), ^{
          // Update data source array and reload table view.
          BooksBorrowed = newBooksBorrowed;
          [self.tableView reloadData];
        });
    }
});

}

questionAnswers(3)

yourAnswerToTheQuestion