title: CoreData and UITableView: display values in cells
body: <p>I'm working with Core Data and web service, I want to add my data to my table,
  but I don't know how should I call them, would you please help me, since when I used this way it's not working.</p>
  
  <p>Here is my method for update database in my HTTP class</p>
  
  <pre><code>- (void)updateLocalCardsDataBase:(NSArray*) cardsArray
  {
      //check if current user has cards in local database
      NSManagedObjectContext* managedObjectContext = [(AppDelegate*) [[UIApplication sharedApplication] delegate] managedObjectContext];
  
      for(NSDictionary *cardDic in cardsArray)
      {
          Card *card = [NSEntityDescription insertNewObjectForEntityForName:@"Card" inManagedObjectContext:managedObjectContext];
          card.remote_id = [NSNumber numberWithInt:[[cardDic objectForKey:@"id"] intValue]];
          card.stampNumber = [NSNumber numberWithInt:[[cardDic objectForKey:@"stampNumber"] intValue]];
          card.createdAt = [NSDate dateWithTimeIntervalSince1970:[[cardDic objectForKey:@"createdAt"] intValue]];
  
          [managedObjectContext lock];
          NSError *error;
          if (![managedObjectContext save:&amp;error])
          {
              NSLog(@"Whoops, couldn't save: %@", [error localizedDescription]);
              NSLog(@"Failed to save to data store: %@", [error localizedDescription]);
              NSArray* detailedErrors = [[error userInfo] objectForKey:NSDetailedErrorsKey];
              if(detailedErrors != nil &amp;&amp; [detailedErrors count] &gt; 0) {
              for(NSError* detailedError in detailedErrors) {
                  NSLog(@"  DetailedError: %@", [detailedError userInfo]);
              }
          }
          else {
              NSLog(@"  %@", [error userInfo]);
          }
      }
      [managedObjectContext unlock];
  }
  </code></pre>
  
  <p>Here is my table:</p>
  
  <pre><code> - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
  {
      // NSManagedObjectContext* managedObjectContext = [(AppDelegate*) [[UIApplication sharedApplication] delegate] managedObjectContext];
      static NSString *CellIdentifier = @"CardsCell";
      CardCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];    
      if (cell == nil){
          NSArray *objects = [[NSBundle mainBundle] loadNibNamed:@"CardCell" owner:nil options:nil];
      for (id currentObject in objects)
      {
          if([currentObject isKindOfClass:[UITableViewCell class]])
          {
              cell = (CardCell *) currentObject;
              break;
          }
      }
  
      NSDictionary *f = [_cards objectAtIndex:indexPath.row];
  
      cell.stampId.text = [f objectForKey:@"stampNumber"];
      NSLog(@"%@fdssfdfddavds",[f objectForKey:@"stampNumber"]);
      cell.createdAt.text = [f objectForKey:@"createdAt"];
      cell.CardId.text = [f objectForKey:@"id"];
      return cell;
  }
  </code></pre>
  
  <p>Edit:</p>
  
  <p><strong>My problem is how I can show data in a <code>UITableView</code></strong></p>