I have a UITableView with a search bar and a search result display controller:
[self.searchDisplayController.searchResultsTableView addSubview:searchIndicator];
searchIndicator.center = CGPointMake(self.view.frame.size.width / 2.0, self.view.frame.size.height / 2.0);
The code above places the indicator at the center of the screen. However I want to place the indicator at the center of the frame excluding the keyboard. How can I do this?
The indicator is defined like this:
@property (retain, nonatomic) IBOutlet UIActivityIndicatorView *searchIndicator;

@SaurabhPrajapati has the right idea in his comment. You'll need to subscribe to one of the keyboard willShow/didShow notifications (
UIKeyboardDidShowNotificationorUIKeyboardWillShowNotification) and when you get a keyboard notification, collect information about the keyboard height from theKeyboard Notification User Info Keys(Search in the Xcode help system on that string for more information.) Save the keyboard height to an instance variable, and then when you get ready to display your activity indicator, use the keyboard height to adjust the position of the indicator as outlined in Saurabh's comment.