如何通過indexPath
獲得UITableViewCell
?像這樣:如何通過indexPath獲取uitableViewCell?
我使用UIActionSheet
,當我點擊確認UIButton
我想更改單元格文本。
我定義爲一個屬性
- (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)
{
}
}
}
}
喜大衛 我改寫了問題,你能看到它再次 – phpxiaoxin 2010-03-05 04:05:40