试图传递cell.profilepic.image我得到这个错误线程1:信号SIGABRT(无法将'UIButton'类型的值转换为'UIImage')

时间:2017-10-23 20:56:54

标签: swift uibutton uiimage runtime-error sigabrt

import java.util.Scanner;
import java.util.Calendar;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class LogSend {
    /**
     * @param args
     * @throws IOException 
     */
    public static void main(String[] args) throws IOException {
        // TODO Auto-generated method stub

        System.out.println("");
        System.out.println("Type '!help' for commands");

        Scanner cmd = new Scanner(System.in);
        String initialCmd = cmd.nextLine();


        if (initialCmd == "!help") {
            System.out.println("The commands are:");
            System.out.println("'!help' for commands");
            System.out.println("'!log' to log an entry");
        } else if (initialCmd == "!log") {
            String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(Calendar.getInstance().getTime());
            System.out.println(timeStamp);

            Scanner entry = new Scanner(System.in);
            String journalEntry = entry.nextLine();
            try (PrintWriter saveLog = new PrintWriter(new FileWriter("log.html", true))) {
                saveLog.println(timeStamp+":"+"<b>"+journalEntry+"</b>"+"<br>");

            }
        }


        /*String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(Calendar.getInstance().getTime());
        System.out.println(timeStamp);

        Scanner entry = new Scanner(System.in);
        String journalEntry = entry.nextLine();
        try (PrintWriter saveLog = new PrintWriter(new FileWriter("log.html", true))) {
            saveLog.println(timeStamp+":"+"<b>"+journalEntry+"</b>"+"<br>");

        } /*catch(FileNotFoundException e) {
            FileWriter fileWriter = new FileWriter("log.html");
            PrintWriter saveLog = new PrintWriter(fileWriter);
            saveLog.println("<html>");
            saveLog.println("<body>");
            saveLog.println(timeStamp+":"+journalEntry);
            saveLog.println("</body>");
            saveLog.println("</html>");
        }*/



    }

}

尝试将cell.profilepic.image从ViewController2传递到ViewController3

在运行时我点击Botton(func bottone)[我的Botton是     在viewController2中的tableView的原型单元格中

我将tableView func放在botton的动作中,因为我希望我的pic3(在ViewController3中声明为UIImage)是我在ViewController2的TableView中单击的图片

import UIKit

0 个答案:

没有答案