按下编辑按钮时如何在导航栏中添加加号按钮?

时间:2015-06-29 15:07:51

标签: ios swift uitableview uiviewcontroller

我正在用TableView控制器编写一个简单的应用程序。此视图有一个导航栏,并有一个编辑按钮。我只想在编辑内容并按下编辑按钮时在左上角添加加号按钮。

我使用以下预先编写的代码添加了按钮:

 #include <stdio.h>
 #include <stdlib.h>
 #include "serialsource.h"

 int main()
 {

   FILE *pfile;
   char *filename="/home/menen/DataFiles/t2.txt";
   pfile=fopen(filename, "r");
   if (pfile == NULL)
    {
       printf("Can not open the file  /home/menen/DataFiles/t2.txt"); 
       exit(1);
    } 

    int i;
    char ch;
    char val[4];
    for(i=0 ;i<10;i++)
    {
      int count=0, j=3;
      ch=getc(pfile);
      while (ch != '\n')
      {
        count++;
        if (count>=62)
        {
          val[j]=ch;
          printf("%c ", val[j]);
          j--;
        }
        ch=getc(pfile); 
      }
      putchar('\n');

    }

    fclose(pfile);
    exit(0);

  }

我不知道当按下创建的编辑按钮时是否有一个方法被调用,但我认为这可以解决这个问题,因为我可以简单地创建在该方法中添加加号按钮。

1 个答案:

答案 0 :(得分:0)

覆盖视图控制器上的Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: lib32stdc++6 : Depends: gcc-4.8-base (= 4.8.2-19ubuntu1) but 4.8.4-2ubuntu1~14.04 is to be installed E: Unable to correct problems, you have held broken packages. 。每次编辑状态改变时都会调用它。

确保先打电话给超级。