Created
May 19, 2011 16:44
-
-
Save Adam0101/981200 to your computer and use it in GitHub Desktop.
FilltheCells
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView | |
{ | |
// Return the number of sections. | |
return 1; | |
} | |
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | |
{ | |
// Return the number of rows in the section. | |
return [[self tweets]count]; | |
} | |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
static NSString *CellIdentifier = @"Cell"; | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | |
if (cell == nil) { | |
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; | |
} | |
NSDictionary *tweet = (NSDictionary *)[tweets objectAtIndex:indexPath.row]; | |
cell.textLabel.text = [NSString stringWithFormat:@"%@",[tweet objectForKey:@"text"]]; | |
cell.detailTextLabel.text = [NSString stringWithFormat:@"User: %@",[tweet objectForKey:@"from_user"]]; | |
NSLog(@"cell text %@",[tweet objectForKey:@"from_user"]); | |
return cell; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment