Challenge: Assets on the iPad Solution


#1

Here is my solution to Assets on the iPad. I hope this helps anyone who is stuck :slight_smile: All i did was change the showAssetTypePicker: in ItemDetailViewController.m

[code]- (IBAction)showAssetTypePicker:(id)sender
{
[[self view]endEditing:YES];
AssetTypePicker *assetTypePicker = [[AssetTypePicker alloc]init];
//rect for popover
CGRect frame = CGRectMake([self view].bounds.origin.x, [self view].bounds.origin.y, 50.0, 50.0);
[assetTypePicker setPossession:possession];

// if on ipad
if([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
    assetPickerPopover = [[UIPopoverController alloc]initWithContentViewController:assetTypePicker];
    
    [assetPickerPopover setDelegate:self];
    
    [assetPickerPopover presentPopoverFromRect:frame inView:[self view] permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

} else { //if not ipad
    [[self navigationController] pushViewController:assetTypePicker animated:YES];
}
[assetTypePicker release];

}[/code]