Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- //NSLog(@"cellForRowAtIndexPath");
- NSString *uniqueIdentifier = @"TwittCell";
- TwittCell *cell = (TwittCell *) [twittsTableView dequeueReusableCellWithIdentifier:uniqueIdentifier];
- Twitt *twitt = [self.arrayTwitts objectAtIndex:[indexPath row]];
- if(!cell)
- {
- NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"TwittCell" owner:nil options:nil];
- for(id currentObject in topLevelObjects)
- {
- if([currentObject isKindOfClass:[TwittCell class]])
- {
- cell = (TwittCell *)currentObject;
- break;
- }
- }
- }
- cell.userLabel.text = twitt.user;
- cell.textLabel.text = twitt.text;
- NSData *imageData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:twitt.pictureUrl]];
- cell.imageView.image = [[UIImage alloc] initWithData:imageData];
- return cell;
- }
Add Comment
Please, Sign In to add comment