类型'uiStackView'的值没有会员'图像'

时间:2016-03-07 15:00:03

标签: swift

导入UIKit // MARK:属性 class ViewController:UIViewController,UITextFieldDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate

{

@IBOutlet weak var nameTextField:UITextField!;
@IBOutlet weak var mealNameLabel: UILabel!
@IBOutlet weak var photoImageView: UIStackView!


@IBAction func setDefaultLabelText(sender: UIButton)
    {

        mealNameLabel.text = "Default Text"

    }


override func viewDidLoad()

    {

        super.viewDidLoad()

        //self = viewController
        nameTextField.delegate = self

    }
        //UItextFieldDelegate
func textFieldShouldReturn(textField: UITextField) -> Bool
    {
        //keyboard goes when done

        textField.resignFirstResponder()

        return true
    }

func imagePickController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) {

    let selectedImage = info[UIImagePickerControllerOriginalImage] as! UIImage


    self.photoImageView.image = selectedImage


    dismissViewControllerAnimated(true, completion: nil)
}

我正在研究Xcode的教程,并且遇到了上面列出的问题。任何帮助,将不胜感激。谢谢!

1 个答案:

答案 0 :(得分:0)

那么photoImageView不应该是UIImageView吗?

@IBOutlet weak var photoImageView: UIImageView!