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 8228365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:26:03+00:00 2026-06-07T16:26:03+00:00

In my app, I have a table view controller that creates a couple of

  • 0

In my app, I have a table view controller that creates a couple of customize cells, which I have created view controllers (.xib) and classes for. In one of those cells, there is a button that triggers a method (at ‘touch up inside’) that is suppose to present the user with an image picker. I have used apple standard code from the documentation for presenting the media picker, but it doesn’t seem to work. I have tried using the cell as both the delegate and view controller which the media picker is created from, and as the delegate for the media picker, but it doesn’t seem to work. I have also tried Insiniciating an object of the UITableView the cell is created in, and using it as the delegate and view controller, which also doesn’t work. I have added the code for the related methods. Any advice on how to do that?

The method to handle buttons ‘touch up inside” (method his in the custom cell class):

- (IBAction)TakeNewPicture:(id)sender {
    [self startCameraControllerFromViewController:self usingDelegate:self];
}

The startCameraController… method (also in the cell’s class):

- (BOOL) startCameraControllerFromViewController: (UIViewController*) controller
                                   usingDelegate: (id <UIImagePickerControllerDelegate,
                                                   UINavigationControllerDelegate>) delegate {

    if (([UIImagePickerController isSourceTypeAvailable:
          UIImagePickerControllerSourceTypeCamera] == NO)
        || (delegate == nil)
        || (controller == nil))
        return NO;


    UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init];
    cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera;

    // Displays a control that allows the user to choose picture or
    // movie capture, if both are available:
    cameraUI.mediaTypes =
    [UIImagePickerController availableMediaTypesForSourceType:
     UIImagePickerControllerSourceTypeCamera];

    // Hides the controls for moving & scaling pictures, or for
    // trimming movies. To instead show the controls, use YES.
    cameraUI.allowsEditing = YES;

    cameraUI.delegate = delegate;

   [controller presentModalViewController: cameraUI animated: YES];
    //[[[[UIApplication sharedApplication] keyWindow] rootViewController] presentModalViewController:cameraUI animated:YES];
    return YES;
}

Thanks for your time! Any support is highly appreciated :] (Objective-c style smiley)

  • 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-07T16:26:04+00:00Added an answer on June 7, 2026 at 4:26 pm

    First I hope u r not running this in the simulator, because as u know it doesn’t have a camera:)

    You say that TakeNewPicture is in the custom cell class, and inside it you call [self startCameraControllerFromViewController:self usingDelegate:self];
    Were self is a custom cell not a UIViewController..

    I would suggest to move this code to the viewController and when u create a cell just do

    [[cell button] addTarget:self action:@selector(TakeNewPicture:) forControlEvents:UIControlEventTouchUpInside];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a categories table view controller. In my app, categories can have subcategories.
I have an app that presents Table View of different files. I have it
I have an iPhone app which has a Table View-based data input screen with
I have an initial table view that I created as the initial menu within
I have an app with a table view in a nav controller; I wanted
I have a navigation controller app. I created a RootViewController class with Xib file.
I have a table view that pushes to a detail view controller. From the
In my iPad app I have a view controller with a small table view.
I have built a CakePHP app that creates appointments which have both a client
I have a view controller that contains a table view, the items in the

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.