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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:36:58+00:00 2026-05-25T14:36:58+00:00

Actually, I want to push data from one view to other. I have a

  • 0

Actually, I want to push data from one view to other. I have a UIScrollView which has images on top of it. Now I want to push the data from that view to other view since whenever I do touch on that image view I want to select the position and push the location to other view.
UIScrollView does not have navigationController and cannot be able to push it.

UIScrollView is on top of UIViewController class. Is there a way to send the UITouch from UIScrollView to UIViewController Class and let that class push the view or do I have to work around some thing.

I have the following code for UIScrollView class,

ImageScrollView.m

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *t = [touches anyObject];
CGPoint touchInScrollView = [t locationInView:imageView];
NSLog(@"x: %f", floor(touchInScrollView.x));
NSLog(@"Y : %f", floor(touchInScrollView.y));

    /****Cant be done since pushViewController is not allowed in UIScrollView.****/

DetailViewController *newView = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
[self.navigationController pushViewController:newView animated:YES];

}
  • 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-05-25T14:36:59+00:00Added an answer on May 25, 2026 at 2:36 pm

    Add this property to ImageScrollView.h

    @property (nonatomic, retain) IBOutlet UIViewController* parentVC;
    

    Add this line after @implementation in ImageScrollView.m

    @synthesize parentVC;
    

    Add this line to your – (void)dealloc method in ImageScrollView.m

    [parentVC release];
    

    If you create your ImageScrollView programmatically, after creation in your view controller:

    imageScrollViewYouJustMade.parentVC = self;
    

    If you create your ImageScrollView in Interface Builder, connect the parentVC outlet to File’s Owner.

    To push a new view controller, in ImageScrollView.m

    [self.parentVC.navigationController pushViewController:newView animated:YES];
    

    Here’s an alternative,

    I can’t say for sure without knowing more about your application, but in general if I had a scroll view containing images that I wanted to tap, I would use a UIButton instead of UIImageView, and do something like

    btnImage = [UIImage imageNamed:@"image.png"];
    [btn setImage:btnImage forState:UIControlStateNormal];
    

    If you aren’t creating buttons programmatically, you can also set an image as it’s background by changing the Type in the Attributes inspector to Custom, and change the Background attribute to the desired image.

    Using a button instead of an image view will allow you to connect the touchDown outlet of the button to an IBAction method in your primary view controller that might look like:

    - (IBAction)smileyFaceButtonTapped:(UIButton*)sender;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi every one actually I want to make a com.google.gson.JsonArray of data:[1,2,3,4,5].How can i
I have a problem. Actually I want to push, but gives some error. error:
Actually I want to populate an array to fill up my table view, but
I got a question ;) Actually I want to use core-data in different threads.
I have posted 3 queries here. Actually I want to join 1st & 2nd
I have got a return from a server which is a block of html,
I have a javascript object (I actually get the data through an ajax request):
I am trying to push user account data from an Active Directory to our
Suppose I have 5 local commits. I want to push only 2 of them
I have a tableview where each cell is populated with dynamic data from an

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.