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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:37:05+00:00 2026-05-15T19:37:05+00:00

EDIT2: I try to summarize my problem and the solutions: I’ve got a TableViewController

  • 0

EDIT2: I try to summarize my problem and the solutions:

I’ve got a TableViewController named DetailedViewController. My intention was to activate TouchesBegan to recognize actions like sliding etc, and normally, the method touchesbegan is replaced with the DidSelectRow method. In many posts on stackoverflow, subclassing the UITableView is the only possibility to realize this.

So i created a SpecificTable with .xib file and i used this as a subclass of UITableViewController by adding the SpecificTable as the nib-file.
Selecting a row works fine, and also the TouchesBegan method (i called a method IN the SpecificTable.m with an Alert.) But now i want to call a Method in the UITableViewController (DetailedViewController) where moveToNextItem is declared like

 -(void)moveToNextItem:(id)sender
{
 [self.navigationController
 pushViewController:bbarChart animated:YES];
}

But by calling this method with [self moveToNextItem] the App crashes by touching. (in the Debugger-Mode, the App crashes in the line of [self moveToNextItem].
What is the right way to call the method of DetailedViewController.m?

  • 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-15T19:37:06+00:00Added an answer on May 15, 2026 at 7:37 pm

    Update: You should probably subclass UITableViewCell rather than UITableView. Then in your table view controller’s cellForRowAtIndexPath: method, return an instance of this subclass rather than an instance of UITableViewCell.

    You will also need to pass a DetailedViewController pointer on to the cell, so that you can invoke its moveToNextItem method in the touchesBegan, etc. methods.

    Adapt this example to your needs:

    MyTableViewCell.h

    @class DetailedViewController;
    @interface MyTableViewCell : UITableViewCell {
        DetailedViewController *dvc;
    }
    @property (nonatomic, retain) DetailedViewController *dvc;
    @end
    

    MyTableViewCell.m

    #import "MyTableViewCell.h"
    #import "DetailedViewController.h"
    @implementation MyTableViewCell
        @synthesize dvc;
        - (void)someMethod { // This would be your touchesBegan, etc. methods
            [dvc moveToNextItem];
        }
        - (void)dealloc {
            [dvc release]; // We retained dvc so we have to release it when we're done with it
            [super dealloc];
        }
    @end
    

    DetailedViewController.h

    @interface DetailedViewController : UITableViewController {
        // iVars here
    }
    // Methods and properties here
    - (void)moveToNextItem;
    @end
    

    DetailedViewController.m

    #import "DetailedViewController.h"
    #import "MyTableViewCell.h"
    @implementation DetailedViewController
        - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
            MyTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyTableViewCell"];
            if(cell == nil) {
                cell = [[[MyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MyTableViewCell"] autorelease];
                cell.dvc = self; // This gives the cell a reference to the detailed view controller
            }
            return cell;
        }
        - (void)moveToNextItem {
            // ...
        }
    @end
    

    There are probably far better ways to achieve what you want, but this is the best I can do without more information.

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

Sidebar

Ask A Question

Stats

  • Questions 478k
  • Answers 478k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Ok sorry for my previous answer, didn't notice it was… May 16, 2026 at 5:35 am
  • Editorial Team
    Editorial Team added an answer this is unhappily not possible. May 16, 2026 at 5:34 am
  • Editorial Team
    Editorial Team added an answer 2) Yes thats possible, infact its the default action when… May 16, 2026 at 5:34 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.