Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9270991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:30:25+00:00 2026-06-18T15:30:25+00:00

I have a split view with a master table view and a detail view.

  • 0

I have a split view with a master table view and a detail view. On the navigation bar of my master view of my split view I have a button that should enable the user to take a picture via imagePicker. But my program keeps crashing when I hit the button. Here’s the procedure of the MasterViewController.m that is called when the button is pushed:

-(void) takePicture:(id) sender
{

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];

if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
    [imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera];
}
else
{
    [imagePicker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
}

[imagePicker setDelegate:self];

//[self presentViewController:imagePicker animated:YES completion:nil];

if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
    UIPopoverController * popOverController = [[UIPopoverController alloc] initWithContentViewController:imagePicker];
    [popOverController presentPopoverFromRect:((UIButton *)sender).frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    //[popOverController presentPopoverFromRect:CGRectMake(700, 1000, 10, 10) inView:self.detailViewController.imageSpace permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

}else {

    [self presentViewController:imagePicker animated:YES completion:nil];
}

}

and here’s the error message:

2013-02-11 09:06:43.975 ImageSplit2[13044:c07] -[UIBarButtonItem frame]: unrecognized selector sent to instance 0x7183d00
2013-02-11 09:06:43.976 ImageSplit2[13044:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIBarButtonItem frame]: unrecognized selector sent to instance 0x7183d00'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:30:27+00:00Added an answer on June 18, 2026 at 3:30 pm

    sender is not a UIButton, it is a UIBarButtonItem which is not a view so it doesn’t have a frame property.

    Change this:

    [popOverController presentPopoverFromRect:((UIButton *)sender).frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    

    to:

    [popOverController presentPopoverFromBarButtonItem:(UIBarButtonItem *)sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    

    Side note: You must use a popover on the iPad if selecting an image from the photo library. However, it is perfectly valid to present a camera based image picker as a full screen view controller. So you may wish to change your if statement from:

    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    

    to:

    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad && imagePicker.sourceType != UIImagePickerControllerSourceTypeCamera)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a split view-based app that presents a master-detail interface, and uses a
Background: I have a Master-Detail view split view controller. In detail table view, I
I have a split-view app with a button in the detail view that, when
I have a tab bar controller in the master view of a split view
I have created split view based ipad app, where master view is table view
I am creating a split-view iPad application. When the user presses the bar button
I have a navigation controller in the master pane of a split view controller.
When using a spilt view controller, I have a Master and Detail View. When
I have an app that I just got setup with a split view controller
I have an app that needs backgrounds for both parts of the split view.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.