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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:54:34+00:00 2026-06-14T13:54:34+00:00

I have a button that will programmatically create a UIImageView with an image for

  • 0

I have a button that will programmatically create a UIImageView with an image for each photo that they choose from their Photo Library. It puts the photo on the View and you can move it around and what not.

When the user holds down on the image it brings up a UIPopOverController on the iPad. From there the user clicks on a button to edit the image that is currently being touched.

The problem I have is that I cannot re-access that UIImageView.image to change the image to the finished image that was just edited.

Here is some code example.

// This figures out what imageView was tapped
- (void)handleEditTapped:(UITapGestureRecognizer *)recognizer {
editImage = (UIImageView*)recognizer.view;

if(UIGestureRecognizerStateBegan == recognizer.state) {
    // Called on start of gesture, do work son!
    popoverEditor = [[UIPopoverController alloc] initWithContentViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"popupEditor"]];
    [popoverEditor presentPopoverFromRect:editImage.bounds inView:editImage permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

}
}

I then will popup my editorController with a button located on the popupEditor View:

- (IBAction)effectsEditorButton:(id)sender {

// This part I've been fooling around with to save the image and re-load it to try and get it to work but it loads successfully to the editor but will not save back to uiimageview.image
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSData *imageData = [defaults dataForKey:@"image"];
UIImage *loadedImage = [UIImage imageWithData:imageData];


myEditorController *editorController = [[myEditorController alloc] initWithImage:loadedImage];
[editorController setDelegate:self];


popoverEditor = [[UIPopoverController alloc] initWithContentViewController:editorController];
[popoverEditor presentPopoverFromRect:self.effectsButtonImage.bounds inView:self.effectsButtonImage permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
   }
}

And then this gets called after the user has finished editing the photo:

- (void)photoEditor:(myEditorController *)editor finishedWithImage:(UIImage *)finishedImage
{

// NSLog(@"TAG: %i",editImage.tag); Tried tags but wouldn't hold the .tag value to re reference it. Would always result in 0 after I set the tag to 10 on handleEditTapped

editImage.image = finishedImage;

[self.popoverEditor dismissPopoverAnimated:YES];
}

I cannot figure out how to re-access the UIImageView.image. I’ve tried tags and nsuserdefaults but to no avail!

Any help would be greatly appreciated!! Thank you!

  • 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-14T13:54:36+00:00Added an answer on June 14, 2026 at 1:54 pm

    This question is highly about application logic and depends greatly on how you’ve designed your objects, not so much on the framework, iOS, or objc. In that regard, a few suggestions about how you might tweak your application design to address this problem. There’s not quite enough info to give a complete answer, but hopefully this helps.

    1. Ensure you have a good data model in the ViewController that defines handleEditTapped:. You should be working with “application data” rather than “presentation data”. i.e. store the users “selections” and use that data to generate the presentation UIImageViews.
    2. Update myEditorController delegate protocol to something like – (void)photoEditor:(myEditorController *)editor finishedWithImage:(UIImage )finishedImage withUserInfo:(NSDictionary) info. Use this to build on the model you defined in 1, passing in info which uniquely identifies the “application data” the user is working with. myEditorController does nothing with the userInfo, except passes it back to your delegate.
    3. When your delegate method gets called back, inspect the data in userInfo (the same controller inserted it as is reading it) and use that to connect back to application data. Approaching it this way is kind of “backwards” from what you’re doing; working out, rather than in.
    4. Consider writing images to the filesystem rather than UserDefaults, which I believe is a better choice for images specifically. You can use unique string keys to connect the rest of your data model to a filesystem path.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 25 textboxes. I have one button that will paste information in a
I have a lot of textboxes. I have a button that will cut the
I have a button that when clicked will run a stored procedure on a
I have a button that, when pressed, will add a new HTML row. Within
I have a button that when pressed, a tableview section will be added and
How to setup(in XML) that the button will have width half of screen. I
I have a button in my XML, that when clicked will toggle the visibility
I currently have a simple form that when you click the save button will
I am trying to create a options button above my scroll view that will
I'm working on a site that will have more than one 'Save' button per

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.