The image cannot be passed during the View transition.

Asked 2 years ago, Updated 2 years ago, 62 views

The signal SIGABRT error appears in the code below.

view controller1

@IBOutlet weak var image1:UIImageView!
@IBOutlet weak var image2:UIImageView!

override func prepare(for segment:UIStoryboardSegue, sender:Any?) {
    let vc2 = segue.destination as!ViewController2
    vc2.image3 = self.image1.image
    vc2.image4=self.image2.image
}

view controller2(vc2)

@IBOutlet weak var image21:UIImageView!
@IBOutlet weak var image22:UIImageView!

var image3:UIimage?
var image4:UIimage?

override func viewDidLoad(){
    super.viewDidLoad()

    self.image21.image=image3
    self.image22.image=image4
}

swift swift3

2022-09-30 11:10

1 Answers

There is no problem with the code you provided.The iOS project you created for verification can be passed over without crashing.

The "signal SIGABRT" error is the most frequent error, but it is often caused by a lack of editing on the Storyboard when "there is no particular problem on the code."Check thoroughly to make sure that the connection is correct and that there are no missing connections left.Changing the name of the View after you put up a connection may result in poor editing.


2022-09-30 11:10

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.