Tag Archives: iOS

UIAlertView – creating and detecting button tap

Declare the UIAlertView delegate in the yourViewController.h:

 

Create the alertView:

 

Detect which alertView button was tapped:

 

UIBarButtonItem – setting retina display and non-retina display toolBar icons

I can never remember how to handle retina display images versus non-retina display images¬†in the toolbar so here’s a reminder:

Add the 2 files to your project:

Then call it the same way on all screen densities:

UIImage will determine the right one to use. If using Interface Builder, point to the image.png and not the @2x image.

UIActivityIndicatorView – add activity indicator to navigation bar

Add an activity indicator as shown here:

Remove the spinner and stop animating: