Skip to content

Instantly share code, notes, and snippets.

View futuretap's full-sized avatar

Ortwin Gentz, FutureTap futuretap

View GitHub Profile
@futuretap
futuretap / weak linking error
Created November 23, 2010 23:13
MessageUI framework now linked as "Required", not "Weak". Using LLVM GCC 4.2, BASE SDK iOS 4.2, Deployment target 3.1.
dyld: Symbol not found: _OBJC_CLASS_$_MFMessageComposeViewController
Referenced from: /var/mobile/Applications/C257779B-F488-4890-A08B-883D2D631258/WhereTo.app/WhereTo
Expected in: /System/Library/Frameworks/MessageUI.framework/MessageUI
in /var/mobile/Applications/C257779B-F488-4890-A08B-883D2D631258/WhereTo.app/WhereTo
@futuretap
futuretap / WebViewController.m
Created November 8, 2010 17:11
Intercept mailto URLs in a UIWebView and send them to a MFMailComposeViewController
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
if ([[[request URL] scheme] isEqualToString:@"mailto"]) {
MFMailComposeViewController *mailViewController = [[MFMailComposeViewController alloc] init];
mailViewController.mailComposeDelegate = self;
NSArray *rawURLparts = [[[request URL] resourceSpecifier] componentsSeparatedByString:@"?"];
if (rawURLparts.count > 2) {
return NO; // invalid URL
}