iPhone application based on the “Utility Application” template and the “i” (info) button

So you have created an amazing iPhone application and based it on the Utility Application template in the iPhone SDK. This template gives you a main view and an alternate view that you can use for preferences or other information. This alternate view is seen by tapping on the info button (which is a round graphical “i”) ┬áin the bottom right corner of the main view.

The development is going like gangbusters, your application is looking real good. You have been developing and testing in the simulator and all is working fine.

But your world gets rocked when you put the application on an actual device. All of a sudden, no one can tap your “i” button, or it takes several tries to finally tap it to display the alternate view.

I feel your pain, as I found myself in the same exact situation.

Well I have found a solution. Apparently the bounding rectangle for the info button in the MainView.xib is pretty small, so I inserted the following code into the viewDidLoad method of RootViewController.m:

CGRect newInfoButtonRect = CGRectMake(infoButton.frame.origin.x - 20,
                            infoButton.frame.origin.y - 20,
                            infoButton.frame.size.width + 40,
                            infoButton.frame.size.height + 40);
[infoButton setFrame:newInfoButtonRect];

Now the info button works every single time.

But I cannot take the credit, here is the link that led me to this solution:

Problem with infoButton on Utility based app (link redacted)

Leave a Reply