Results 1 to 3 of 3
  1. #1
    Displaying a UIImageView in main ViewController after choosing from UIPopOver

    Member Since
    Nov 09, 2011
    Posts
    1
    Rep Power
    0
    Displaying a UIImageView in main ViewController after choosing from UIPopOver
    I'm quite new to Xcode and I'm trying to get my chosen Image to display in my main ViewController after selecting it from a UIPopover. I have an Image Library set up as well as a capture image selection, both in my PopoverController. When I take a photo or choose an existing photo, I want it to display in my main ViewController. Here's the code I have:
    Code:
    -(IBAction)tabBtn1:(id)sender {
        
        CapPhoto *capPhoto = [[CapPhoto alloc] init];
        UIPopoverController *pop = [[UIPopoverController alloc] initWithContentViewController:capPhoto];
        [pop setDelegate:self];
        [pop presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
        [pop setPopoverContentSize:CGSizeMake(200, 80)];
        [capPhoto release];
        
    }
    That IBAction is in my main View controller .m file
    Then:
    Code:
    -(IBAction)getPhoto:(id)sender {
        UIImagePickerController *picker = [[UIImagePickerController alloc] init];
        picker.delegate = self;
        picker.sourceType = UIImagePickerControllerSourceTypeCamera;
        
        [self presentModalViewController:picker animated:YES];
    }
    
    - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
        [picker dismissModalViewControllerAnimated:YES];
        imageView.image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
    }
    This code is in my PopoverController. The imageView is my instance for UIImageView which is in my Main ViewController and I'm trying to refer to it in my UIPopOver and I just can't figure out how to get it to display in the main ViewController once I've taken the Photo.
    Any Help would be really appreciated!

  2. #2
    Displaying a UIImageView in main ViewController after choosing from UIPopOver
    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,853
    Your Mac's Specs
    Early 2015 13" rMBP
    Rep Power
    31
    Moved to a more appropriate forum. This will help in eliciting answers.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  3. #3
    Displaying a UIImageView in main ViewController after choosing from UIPopOver
    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Your Mac's Specs
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    Rep Power
    18
    Just a thought. Your imageView ivar is part of your UIViewController, but that wouldn't display the image unless you have such a UIImageView as part or your interface file and connected to the ivar as a reference outlet. The image would have to be added to the view of the UIViewController otherwise.
    CameraTime - Time lapse photography for novice and advanced users.

    When asking questions, post the version of your software. You'll receive better answers.

    Please post your results to the thread as it is good feedback.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to from viewController to NavigationController?
    By fabiohenrique in forum iOS Development
    Replies: 0
    Last Post: 07-14-2013, 08:38 AM
  2. Need Suggestions Naming ViewController
    By Loon3y in forum iOS Development
    Replies: 0
    Last Post: 12-03-2012, 07:59 AM
  3. Replies: 7
    Last Post: 05-20-2012, 04:59 AM
  4. How can I call another viewController through an event?
    By lftapajos in forum iOS Development
    Replies: 0
    Last Post: 02-01-2012, 10:26 AM
  5. UIImageView Size Problem
    By Loon3y in forum iOS Development
    Replies: 4
    Last Post: 12-28-2011, 04:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •