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

  • Home
  • SEARCH
  • 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 6173653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:36:48+00:00 2026-05-23T23:36:48+00:00

So, another EXC_BAD_ACCESS topic on StackOverflow, but as I’m new to Objective-C this is

  • 0

So, another EXC_BAD_ACCESS topic on StackOverflow, but as I’m new to Objective-C this is still a topic I don’t really grasp yet. Even though I have done a lot of research about it already.

The issue is the following. I have a UIScrollView that I have overwritten using a Custom Class (named MultiSelectView). If the user taps this UIScrollView and then I want to open a view that allows him to select some data.

So I have declared a UITapGestureRecognizer that calls the openMultiSelect: method. But on the line [parent.navigationController pushViewController:view animated:YES]; I get a Program received signal: "EXC_BAD_ACCESS". error. Why o why?

- (id) initWithCoder:(NSCoder *) coder {
    self = [super initWithCoder: coder];

    if (self) {
        // Add a Tap Gesture Recognizer to the Scrollview.
        // If the user taps the view, it triggers the 'openMultiSelect' method.
        UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(openMultiSelect:)];
        [singleTap setNumberOfTapsRequired:1];
        [singleTap setNumberOfTouchesRequired:1];
        [self addGestureRecognizer:singleTap];
    }

    return self;
}

- (void)openMultiSelect:(UIGestureRecognizer *)gesture {
    //int myViewTag = gesture.view.tag;  // now you know which view called

    DataSelectView *view = [[DataSelectView alloc] initWithNibName:@"DataSelectView" bundle:[NSBundle mainBundle]];
    view.allowMultiSelect = YES;

    [parent.navigationController pushViewController:view animated:YES];
    [view release];
}

So the parent that you see is a ViewController that contains the tab. Is there a better way to do this? Because for now I have thus a ViewController that contains Tabs. In its activateTab: method I thus create the tab and pass self along. I do the same in the viewDidLoad for that tab to pass the parent to the custom UIScrollView:

- (void) activateTab:(int)index {
   ... code ...

   self.tab_Basic = [[TabBasic alloc] initWithNibName:@"TabBasic" bundle: [NSBundle mainBundle]];
   self.tab_Basic.parent = self;

   ... code ...
}
  • 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-23T23:36:48+00:00Added an answer on May 23, 2026 at 11:36 pm

    What you are doing wrong is releasing the object “view” too early, don’t release it until the view is popped. That should fix the problem.

    - (void)openMultiSelect:(UIGestureRecognizer *)gesture {
    //int myViewTag = gesture.view.tag;  // now you know which view called
    
    DataSelectView *view = [[DataSelectView alloc] initWithNibName:@"DataSelectView" bundle:[NSBundle mainBundle]];
    view.allowMultiSelect = YES;
    
    [parent.navigationController pushViewController:view animated:YES];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is yet another EXC_BAD_ACCESS question. Although I've done my homework and am certain
I ran into this problem while developing in Objective-C for iOS, but this should
Another easy one hopefully. Let's say I have a collection like this: List<DateTime> allDates;
another sql problem of mine .. this time the reader doesn't work properly (
Another question related to this one . I have a List<SortableObjects> that is the
Maybe a very basic problem, but i don't get it ... I've written my
I get this exc_bad_access when I run the application on device ( iPhone 4
Ok I've got a dreaded EXC_BAD_ACCESS that I can't seem to track down but
I am constantly getting the EXC_BAD_ACCESS error in multiple places but always on the
I don't really know if what I'm doing is the right way to do

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.