This is a weird and frustrating problem because these codes work on my friends computer and iPhone device when i asked him to test it, but it does not work on my computer and iPhone 4. The error is called "Thread 1: EXC_BAD_ACCESS(code=1,address=0x10)" and it occurs on the var alert declaration. This occurs after i click the button on my iPhone device during testing.
@IBAction func button(sender: AnyObject) {
self.showRateMe()
}
//MARK: - Private Methods
func showRateMe()
{
var alert = UIAlertController(title: "Rate Us", message: "Thanks for
using the app! We value your feedback. Please take a few seconds to
review our app to make it better", preferredStyle:
UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "Hello!", style: UIAlertActionStyle.Default, handler:
{ alertAction in
self.openReviewPage()
alert.dismissViewControllerAnimated(true, completion: nil)
}))
alert.addAction(UIAlertAction(title: "No Thanks", style: UIAlertActionStyle.Default, handler: { alertAction in
alert.dismissViewControllerAnimated(true, completion: nil)
}))
/*
alert.addAction(UIAlertAction(title: "Maybe Later", style: UIAlertActionStyle.Default, handler: { alertAction in
alert.dismissViewControllerAnimated(true, completion: nil)
}))
*/
self.presentViewController(alert, animated: true, completion: nil)
}