我正在尝试做类似于Twitter或Facebook的事情.
解决方法@H_502_4@
- - (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
- {
- static NSString* CellIdentifier = @"Cell";
-
- UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
- if (cell == nil)
- cell = [[[UITableViewCell alloc] UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
-
- cell.textLabel.text = @"I'm a UITableViewCell!";
- cell.imageView.image = [UIImage imageNamed:@"MyReallyCoolImage.png"];
-
- return cell;
- }
- - (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
- {
- static NSString* CellIdentifier = @"Cell";
- UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
- if (cell == nil)
- cell = [[[UITableViewCell alloc] UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
- cell.textLabel.text = @"I'm a UITableViewCell!";
- cell.imageView.image = [UIImage imageNamed:@"MyReallyCoolImage.png"];
- return cell;
- }