Skip to content

Category Archives: Coding

Programmatically show Mail settings in iOS

MFMailComposerViewController can’t handle a device without a mail account defined, a easy and nice way to get around it is to do like this: if ([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *mailController = [[MFMailComposeViewController alloc] init]; mailController.mailComposeDelegate = (id<MFMailComposeViewControllerDelegate>) self; [mailController setMessageBody:@"Test Mail" isHTML:YES]; [self presentModalViewController:mailController animated:YES]; } else { NSString *bodyText = @"Test Mail"; NSURL *url [...]

Visual merge with Git on Mac OS X

Mac developer tools have a tool include called FileMerge + a command line based tool called opendiff to invoke it, to use this tool in Git, run this command: git config –global merge.tool opendiff then when you want to do a merge you can just use the command: git mergetool Easy and simple, the things [...]

Static (Read-only) text in Settings Bundle

Since I couldn’t find this anywhere else I will write it here on my blog, to add a static (read-only) text to the Settings Bundle add this to the plist (easiest using the source code editor). <span style="font-family: monospace;">&lt;dict&gt;</span> <span style="font-family: monospace;">&lt;key&gt;Key&lt;/key&gt;</span> <span style="font-family: monospace;">&lt;string&gt;version_preference&lt;/string&gt;</span> <span style="font-family: monospace;">&lt;key&gt;Type&lt;/key&gt;</span> <span style="font-family: monospace;">&lt;string&gt;PSTitleValueSpecifier&lt;/string&gt;</span> <span style="font-family: monospace;">&lt;key&gt;DefaultValue&lt;/key&gt;</span> <span [...]

Translucent navigationBar with a UITableView

When using a translucent navigation bar, the content of the table gets “below” it, to fix the problem use this line of code. tableview.contentInset = UIEdgeInsetsMake(navigationController.navigationBar.frame.size.height, 0,0,0); It’s almost like magic, now the content of the table will not be “below” the translucent navigation bar.