ViewController
当按下警报视图中的“下一步”按钮时,我想将一个数组传递给另一个数组。
userInformation += [userName, userGender, String(userAge), String(userHeight), String(userWeight)]
let alert = UIAlertController(title:"Confirmation", message: confirmationMessage, preferredStyle: UIAlertControllerStyle.Alert)
let confirmBtn : UIAlertAction = UIAlertAction(title: "Next", style: UIAlertActionStyle.Default, handler: {(action:UIAlertAction!)-> Void in
let vc = (self.storyboard?.instantiateViewControllerWithIdentifier("toPerInfo"))! as UIViewController
print(self.userInformation)
self.showDetailViewController(vc, sender: self)
})
let cancelBtn : UIAlertAction = UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel, handler: nil)
alert.addAction(cancelBtn)
alert.addAction(confirmBtn)
self.presentViewController(alert, animated: true, completion: nil)
这是perpareForSegue
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
var destViewController: PersonalInformation = segue.destinationViewController as! PersonalInformation
var arrayToSegue: [String] = self.userInformation
destViewController.useInfo = arrayToSegue
}
我想把perpareForSegue
进入“下一步”按钮。我应该如何修改我的代码..我找不到其他类似的问题...