Skip to content

Instantly share code, notes, and snippets.

@ianterrell
Created April 23, 2012 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianterrell/2471387 to your computer and use it in GitHub Desktop.
Save ianterrell/2471387 to your computer and use it in GitHub Desktop.
class NSString < Mobi::Cocoa::Object
end
class UIAlertView < Mobi::Cocoa::Object
def self.alert(title, message, options={})
alert = UIAlertView._alloc \
._initWithTitle _S(title),
:message, _S(message),
:delegate, nil,
:cancelButtonTitle, options[:cancel_title] ? _S(options[:cancel_title]) || nil,
:otherButtonTitles, nil
alert._show
end
end
def _S(str)
NSString._stringWithUTF8String str
end
UIAlertView.alert("Hello World", "This is a really really easy alert!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment