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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:27:44+00:00 2026-05-15T08:27:44+00:00

I have a UIScrollView with an Image subView. I subclass touchesEnded to add a

  • 0

I have a UIScrollView with an Image subView. I subclass touchesEnded to add a dialog box as a subView as follows:

- (void) pushInfoBox {
    // the following line is referred to "myVC Caller" below
    myViewController *myVC = [[myViewController alloc] 
                              initWithNibName:@"myView" bundle:nil];
    [self addSubview:myVC.view];
    [myVC release];
}

The view shows correctly, but when I click myVC.view.backButton the code execution jumps to the “myVC Caller” line above. The next step dumps with -[myViewController performSelector:withObject:withObject:]: message sent to deallocated instance.

Strangely the myCaller.IBAction (backButton action) is not executed.

I expect the user interaction enabled between the scrollview and the pushed message box interfere with each other, but am unsure how to handle this correctly.

any ideas on how to tackle this?

  • 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-15T08:27:45+00:00Added an answer on May 15, 2026 at 8:27 am

    There are several major issues with your code. I’ll walk through it:

    - (bool)pushInfoBox:(int)xPos down:(int)yPos window:(int)wPos {

    First of all, you’re not returning a BOOL value in this method so the return type should be void (if it was returning a BOOL, note that its uppercase, not lowercase as you have it now). Second, you are supplying xPos, yPos, and wPosas arguments but they are not being used in the method. So your method declaration should look more like this:

    - (void)pushInfoPox;

    The next problem is here:

    myViewController *myVC = [[myViewController alloc]
    initWithNibName:@"myView" bundle:nil];

    You are allocating an instance of myViewController (by the way, class names should always have their first letter capitalized) but never releasing it, so you are causing a memory leak. You should be declaring myVC as an instance variable and a retained property in your header:

    @interface ...
    {
        ...
        myViewController *myVC
    }
    ...
    @property (nonatomic, retain) myViewController myVC;
    @end
    

    You should be allocating it like this now:

    myVC = [[myViewController alloc]
    initWithNibName:@"myView" bundle:nil];

    And it should be released in the dealloc method:

    - (void)dealloc
    {
        [myVC release];
        [super dealloc];
    }
    

    The last problem is in this line:

    [mBox release];

    I don’t see any object called mBox being retained in that method, so that line should not be there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIScrollView and I add 9 imageview to it using the following
I have a UIScrollView that contains an image and a segmented control that allows
I have an Image inside UIScrollView which i can zoom in and out. I
I have an image in an UIScrollView, that can be scrolled and zoomed. When
I have a UIImageView that is housed inside a UIScrollView . The image in
I have a subclass of UIScrollView that I'm using for images slideshow, with infinite
So I have a UIImageView as a subview of UIScrollView , I've set the
I have a UIScrollView with a UIImageView subview created in IB. The first time
I have a UIScrollView whose content size is 1200x480. I have some image views
I have paging UIScrollView with images. I want to implement animated zooming of image

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.