Latest Articles

Use the navigation at the bottom to see older articles

What are the button indexes in a three-button UIAlertView

The cancel button is always index 0, and all other buttons in the array start at index 1 counting up. For completion, here’s how to create it: – (IBAction)showAlert:(id)sender { // create an alert view with three buttons UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@”Three Button Alert” message:@”This is an alert view with more than two buttons. […]

How to restore your single In-App Purchase in iOS

This is an addition to my previous article. To allow uses to restore their In-App Purchases you can expand on the previous article and include the following method in your Shop class. This needs to be public so it can be called from your main class: – (BOOL)restoreThePurchase { // verify/refresh receipt here (even though […]

How to restore your single In-App Purchase in iOS

This is an addition to my previous article. To allow uses to restore their In-App Purchases you can expand on the previous article and include the following method in your Shop class. This needs to be public so it can be called from your main class: – (BOOL)restoreThePurchase { // verify/refresh receipt here (even though […]

How to create a single In-App Purchase in iOS 7

This “simple everyday” feature has caused me many headaches on many occasions. Implementing a simple unlockable feature isn’t as straightforward as it perhaps could be – and I’ll make it as simple as possible (so I won’t forget next time I need to add it to an app). In this example we’re going to have […]

How to open the LinkedIn App from your own iOS App

Here’s a sample action that tries to open a LinkedIn Profile with the LinkedIn App. If it’s not installed, it opens a link to the profile in Safari. If that doesn’t work it gives a log message (please handle appropriately in your own code): – (IBAction)openLinkedIn:(id)sender { // open the LinkedIn App if (![[UIApplication sharedApplication] […]

How to create a Twitter Follow button in your iOS App

Much like the Facebook Like button we can create a Twitter Follow button. It’s easy to create a HTML button which we can load into a small UIWebView (about 40 pixels high): – (void)viewDidLoad { [super viewDidLoad]; // add Twitter Follow button in a web view NSString *twitterFollowButton = @”<a href=’https://twitter.com/versluis’ class=’twitter-follow-button’ data-show-count=’true’ data-size=’large’>Follow @versluis</a><script>!function(d,s,id){var […]