September 2013
Intermediate to advanced
112 pages
2h 42m
English
Now that we understand how our app boots up and we have our entry point, let’s try something. We’re going to show a UIAlertView, which is the standard blue pop-up you see when you get an error message or push notifications pre-iOS5. Let’s change application:didFinishLaunchingWithOptions: to add an alert right before returning.
| | class AppDelegate |
| | def application(application, didFinishLaunchingWithOptions:launchOptions) |
| » | @alert = |
| » | UIAlertView.alloc.initWithTitle("Hello", |
| » | message: "Hello, RubyMotion", |
| » | delegate: nil, |
| » | cancelButtonTitle: "OK", |
| » | otherButtonTitles: nil) |
| » | @alert.show |
| » | |
| » | puts "Hello from the console!" |
| | |
| | true |
| | end |
| |
Read now
Unlock full access