【发布时间】:2011-12-19 16:35:09
【问题描述】:
我对此进行了一些搜索,但希望我不会创建重复项(毕竟是凌晨 4 点)。我也希望这对大师来说是一个容易回答的问题,但我现在找不到。
我有一个 UITableView 用于应用程序设置。当您选择其中一行时,它会添加复选标记附件。由于它是一个模态窗口,我已将其设置为在您选择它后关闭该窗口。但是,我当前的代码会在您选择它时立即关闭窗口,并且您看不到选择动画(以及随后出现的复选标记)。我的模态窗口代码基于AddMusic 示例项目。
有没有办法在执行关闭命令之前让表格行闪烁几次,以便很明显选择了哪一行?
作为参考,我的模态窗口是UIViewController <UITableViewDelegate>
而我的选择行代码如下:
- (void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath {
UITableViewCell *oldCell = [tableView cellForRowAtIndexPath:self.selectedIndexPath];
oldCell.accessoryType = UITableViewCellAccessoryNone;
UITableViewCell *newCell = [tableView cellForRowAtIndexPath:indexPath];
newCell.accessoryType = UITableViewCellAccessoryCheckmark;
[self setSelectedIndexPath:indexPath];
[tableView deselectRowAtIndexPath: indexPath animated: YES];
// close the window when an option is selected.
[self.delegate movieCinemaViewControllerDidFinish: self];
}
【问题讨论】:
-
添加了我的模态窗口代码基于 Apple 的 AddMusic 示例项目这一事实。
标签: iphone objective-c ios uitableview