【发布时间】:2011-01-23 23:23:46
【问题描述】:
如何通过indexPath 获得UITableViewCell?像这样:
我使用UIActionSheet,当我点击确认时UIButton我想更改单元格文本。
我定义为属性的 nowIndex
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == 0)
{
NSInteger section = [nowIndex section];
NSInteger row = [nowIndex row];
NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];
formatter.dateFormat = @"yyyy-MM-dd";
if (section == 0)
{
if (row == 0)
{
}
else if (row == 1)
{
UILabel *content = (UILabel *)[[(UITableView *)[actionSheet ] cellForRowAtIndexPath:nowIndex] viewWithTag:contentTag];
content.text = [formatter stringFromDate:checkInDate.date];
}
else if (row == 2)
{
}
}
}
}
【问题讨论】:
标签: iphone uitableview nsindexpath