UIBarButtonItem
iOS 5.1 iPad 1 では表示されませんが、iPad 4 の iOS 6 では動作します。
_itemForImport = [[UIBarButtonItem alloc] initWithTitle:LS(@"Library", @"") style:UIBarButtonItemStyleBordered target:self action:@selector(itemForImportTouched)];
+ (void) presentInPopoverFromBarButtonItem:(UIBarButtonItem *)item withSourceType:(NSString*)sourceType {
UIPopoverController* popover = [IPadFilesViewController getPopoverController];
if (popover)
return;
IPadImagePickerController* pickerController = [[IPadImagePickerController alloc] initWithSourceType:sourceType];
popover = [[UIPopoverController alloc] initWithContentViewController:pickerController];
popover.delegate = pickerController;
[IPadFilesViewController setPopoverController:popover];
[popover presentPopoverFromBarButtonItem:item permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}