TableViewCell将数据传递给ViewController(Parse.com)?

时间:2017-10-09 16:10:25

标签: ios swift parse-platform uiviewcontroller

告诉我可能是个错误。我有6列,两列属于TableViewCell。其他4个属于ViewController。 如何正确绑定行以使匹配信息与TableViewCell中的行匹配enter image description here     导入UIKit     import Parse

class DetailTennisViewController: UIViewController {

    @IBOutlet weak var imageTennis: UIImageView!
    @IBOutlet weak var outClose: UIButton!
    @IBOutlet weak var titleTennis: UILabel!
    @IBOutlet weak var textTennis: UITextView!
    @IBOutlet weak var progTennis: UILabel!

    @IBAction func closeOut(_ sender: Any) {
        dismiss(animated: false, completion: nil)
    }

    var tenises : Tennis?

    func configureButton() {
        outClose.layer.cornerRadius = 0.5 * outClose.bounds.size.width
        outClose.clipsToBounds = true
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        loadTennis()
        configureButton()
    }


    func loadTennis () {
         let qwery = PFQuery(className: "tennis")
            qwery.getFirstObjectInBackground() { (object,error) ->Void in
            if error == nil {
                self.textTennis.text = object!["textTen"] as? String
                self.progTennis.text = object!["progTen"] as? String
                self.titleTennis.text = object!["titleTen"] as? String
                let imageFile = object!["tenImage"] as? PFFile
                imageFile?.getDataInBackground() { (data:Data?, error:Error?)->Void in
                    if error == nil {
                        if let imageData = data {
                              self.imageTennis.image = UIImage(data: imageData)
                        }
                    }
                 }
            }
         }

     }
}

如何制作数据字符串Parse.com如何使数据TableViewCell单元格对应于ViewController的描述。在我的代码中,当单元格打开时,会显示相同的数据。我上传了4个关于它们的事件和信息。所以关于它们的信息也是如此。如何制作由" objectId"

表示的那个

0 个答案:

没有答案