Category Archives: iPad

Handling rotations in UIViewController

In this post I’ll give a few general tips for handling device rotations at the UIViewController level.  These tips are for code using iOS (formerly known as iPhone OS) 3.0 or later, which includes all iPad code. 1.  In willAnimateRotationToInterfaceOrientation:duration:, size and position the view for the new orientation. This sounds obvious and easy, but there […]

Fast numeric queries

This post introduces a relatively new algorithm, along with an open-source demo iPad app, that can pre-process a large set of numeric data to help perform extremely fast error-tolerant lookups at query time. Problems you can solve There is a class of algorithms known as locality-sensitive hashing (LSH) algorithms; this is a new one of […]

UIScrollView bug

This post describes a bug in UIScrollView that occurs when you programmatically set the contentOffset with animation. Below is code to reproduce the bug; I’ve confirmed it’s in iPhone OS 3.2 but it may be in other versions as well. If you make a call to [scrollView setContentOffset:offset1 animated:YES]; and later make a call to […]

Simplified popovers

In this post, I’ll present a microclass that can give you simplified popover ( UIPopoverController ) handling in many cases, including automatic rotation updates. Links to code below. What PopoverHelper does Normally, this is how you need to work with a popover: Set up the content view controller that will appear in the popover. Alloc […]