我想在UITableview中选择多行,就像Apple在原生Alarm应用程序中所做的那样(见图片) 
我怎样才能做到这一点?
到目前为止我看到的所有答案都是旧的(并且说"不能做")或者引用本机Mail应用程序中的多行选择.那个方法不是我想要的,因为你必须首先进入"编辑"模式.我希望能够立即选择行.
希望有人能提供帮助.
基督教
我如何调整它以便能够进行多项选择?并获得所选的
- (id)initWithCellIdentifier:(NSString *)cellID {
if ((self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID])) {
UITableViewCell *cell=self;
UIImage *cry = [UIImage APP_CRYSTAL_SELECT];
self.leftImage = [[[UIImageView alloc] initWithImage:cry] autorelease] ;
[self.contentView addSubview:leftImage];
}
Run Code Online (Sandbox Code Playgroud)
选择的方法是:
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
if(selected)
{
NSArray *subviews=[self.contentView subviews];
for(UIView* view in subviews){
if([view isEqual:self.leftImage]){
[self.leftImage setHighlightedImage:[UIImage APP_CRYSTAL_SELECTED]];
}
}
}
else
{
NSArray *subviews=[self.contentView subviews];
for(UIView* view in subviews){
if([view isEqual:self.leftImage]){
[self.leftImage setHighlightedImage:[UIImage APP_CRYSTAL_SELECT]];
}
}
}
}
Run Code Online (Sandbox Code Playgroud) 我遇到了几个博客,告诉我们如何做到这一点,但我不确定苹果是否接受或拒绝这些应用程序.我经历的链接如下:
请各位朋友帮我解决一下如何做到这一点的简单解决方案?
我开始知道有一个委托函数:
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 3;
}
Run Code Online (Sandbox Code Playgroud)
但是如何实现这一点以及如何选择具有复选标记的特定行,因为它是在Apple的标准邮件应用程序中完成的?