每当我点击列中的最后一行,应用程序就会在iPhone上崩溃,但不会在模拟器上崩溃。其他一切正常。我没有收到任何错误消息。代码与模拟器一起工作得很好。iPhone上的应用程序崩溃不在模拟器上
import UIKit
class EarthVC: UIViewController {
@IBOutlet var slideShow1: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
slideShow1.animationImages = [
UIImage(named: "Earth1.jpg")!,
UIImage(named: "Earth2.jpg")!,
UIImage(named: "Earth3.jpg")!,
UIImage(named: "Earth4.jpg")!,
UIImage(named: "Earth5.jpg")!,
UIImage(named: "Earth6.jpg")!,
UIImage(named: "Earth7.jpg")!,
UIImage(named: "Earth8.jpg")!,
UIImage(named: "Earth9.jpg")!,
UIImage(named: "Earth10.jpg")!,
UIImage(named: "Earth11.jpg")!,
UIImage(named: "Earth12.jpg")!,
UIImage(named: "Earth13.jpg")!,
UIImage(named: "Earth14.jpg")!,
UIImage(named: "Earth15.jpg")!,
UIImage(named: "Earth16.jpg")!,
UIImage(named: "Earth17.jpg")!,
UIImage(named: "Earth18.jpg")!,
UIImage(named: "Earth19.jpg")!,
UIImage(named: "Earth20.jpg")!,
UIImage(named: "Earth21.jpg")!,
UIImage(named: "Earth22.jpg")!,
UIImage(named: "Earth23.jpg")!,
UIImage(named: "Earth24.jpg")!,
UIImage(named: "Earth25.jpg")!,
UIImage(named: "Earth26.jpg")!,
UIImage(named: "Earth27.jpg")!,
UIImage(named: "Earth28.jpg")!,
UIImage(named: "Earth29.jpg")!,
UIImage(named: "Earth30.jpg")!,
UIImage(named: "Earth31.jpg")!
]
slideShow1.animationDuration = 93
slideShow1.startAnimating()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
请包括您看到的一些代码或错误消息,以便更好地理解您的问题。 – Nirupa
谢谢你回答我的问题。现在我已经发布了上面的代码。 – Ram
尝试添加异常断点,以便您可以检查哪一行代码会导致崩溃 –