I am trying to show UIAlertView in my quick application
alert = UIAlertView(title: "", message: "bla", delegate: self, cancelButtonTitle: "OK") alert!.show()
=> BAD_ACESS error in: - [_ UIAlertViewAlertControllerShim initWithTitle: message: delegate: cancelButtonTitle: otherButtonTitles:] ()
so I suspected myself. I set it to nil
alert = UIAlertView(title: "", message: "bla", delegate: nil, cancelButtonTitle: "OK") alert!.show()
=> ARM_DA_ALIGN error in: - [_ UIAlertViewAlertControllerShim initWithTitle: message: delegate: cancelButtonTitle: otherButtonTitles:] ()
full code
import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, UIAlertViewDelegate { @lazy var window = UIWindow(frame: UIScreen.mainScreen().bounds) @lazy var locationManager = CLLocationManager() var alert: UIAlertView? = nil func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
How to do it right? :)
swift uialertview uialertcontroller
Daij-Djan Jun 04 '14 at 14:41 2014-06-04 14:41
source share