Skip to content

Instantly share code, notes, and snippets.

@satococoa
Created October 30, 2012 05:19
Show Gist options
  • Select an option

  • Save satococoa/3978440 to your computer and use it in GitHub Desktop.

Select an option

Save satococoa/3978440 to your computer and use it in GitHub Desktop.
crash when deployment_target='5.1' or '5.0'
class MyViewController < UIViewController
def viewDidLoad
super
view.backgroundColor = UIColor.whiteColor
end
def viewDidAppear(animated)
super
if TWTweetComposeViewController.canSendTweet
tw = TWTweetComposeViewController.new.tap do |c|
c.setInitialText('hoge')
c.completionHandler = lambda {|result|
dismissModalViewControllerAnimated(true)
}
end
self.presentModalViewController(tw, animated:true)
end
end
end
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
controller = MyViewController.new
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
@window.rootViewController = controller
@window.makeKeyAndVisible
true
end
end
@satococoa

Copy link
Copy Markdown
Author
Objective-C stub for message `canSendTweet' type `c@:' not precompiled. Make sure you properly link with the framework or library that defines this message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment