小编Max*_*Max的帖子

iPhone:修改在didSelectRowAtIndexPath中选择的单元格

我有一个表,其中包含用户可以选择的条目,当单击它们时,UILabel应该转到UITextField,以便用户可以编辑该行的值.

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if(indexPath.section == 1 &&
       indexPath.row < [item.entries count])
    {
        ListDetailCell *tmpCell = ((ListDetailCell*)[self tableView:tvEntries cellForRowAtIndexPath:indexPath]);
        tmpCell.lbTitle.hidden = true;  // <- cell to hide
        tmpCell.tfTitle.hidden = false; // <- textfield to show
    }
}
Run Code Online (Sandbox Code Playgroud)

出于任何原因,似乎我对控件的更改未得到应用.

这里有什么提示吗?Thx提前

iphone uitableview

5
推荐指数
2
解决办法
5498
查看次数

将项目从一个列表移动到另一个列表

我有一个列表,其中包含Student类型的对象,其中包含姓名,姓氏,身份证,年份等属性.我想要的是我从具有特定索引的列表中删除特定学生并将其放入另一个列表中.有办法吗?例如:

        if (((mystudent[index].Year== 7)) {
              mystudent.RemoveAt(index);
           // now how I shall throw the Student to a new list
}
Run Code Online (Sandbox Code Playgroud)

感谢您的信息.我现在的问题是我在单独的类中有2个列表.当我从列表中删除它的工作时,但当我想从另一个类中查看添加的项目到列表时,我没有得到该项目.

public class SeniorStudentsClass
    {
        public List<Student> studlist = new List<Student>();

public void ViewStudents()
        {
            for (int i = 0; i < studlist.Count; i++)
            {               
                Console.Write(studlist[i].Id + "\t");
                Console.Write(studlist[i].Year + "\t");
                Console.Write(studlist[i].Name + "\t");
                Console.Write(studlist[i].Surname + "\t");
                Console.Write(studlist[i].DOB + "\t");
                Console.Write(studlist[i].Addr);
                Console.WriteLine();
            }

  public class JuniorStudentsClass
    {
       public List<Student> mystudent = new List<Student>();  
       SeniorStudentsClass sc = new SeniorStudentsClass();

        public void PromoteStudents(int …
Run Code Online (Sandbox Code Playgroud)

c#

1
推荐指数
2
解决办法
8203
查看次数

标签 统计

c# ×1

iphone ×1

uitableview ×1