0

I'm have been working in a project using both swift and Objective-C. Every thing went right when I run my code in iOS 8 device using Xcode 6. I want my project also run on devices running iOS 7. However, when I run my code in iOS 7 device, it just crash. It is weird. After hours debug, I find that the crash cause by this code:

var alert:UIAlertController = UIAlertController(title: "Agreement Issue", message: "Please check the agreement box to continue", preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil))

I used UIAlertController here because Apple has been replaced UIAlertView with UIAlertController. When I remove the above mentioned codes, then my project can build and run in iOS 7 device.

Can someone explain this?thanks in advance. Sorry for my poor english.

newacct
  • 115,460
  • 28
  • 157
  • 222
fengtao.ft
  • 81
  • 5

0 Answers0