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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:35:34+00:00 2026-05-31T07:35:34+00:00

I build a TableView with custom TableViewCell, the first custom cell have a tool

  • 0

I build a TableView with custom TableViewCell, the first custom cell have a tool bar and some Bar button Item and also a simple button for test.
The problem is : When I click in any bar button item or into simple button I have a EXC_BAD _ACCESS ?

This is my code to build the tableview cells :

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{    
    static NSString *CellIdentifier = @"taskCell";

    if(indexPath.row != 0){

        TaskCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

        if (cell == nil) {

            NSArray* views = [[NSBundle mainBundle] loadNibNamed:@"TaskCell" owner:nil options:nil];

            for (UIView *view in views) {
                if([view isKindOfClass:[UITableViewCell class]])
                {
                    cell = (TaskCell*)view;
                }
            }
        }
        return cell;
    }
    else{

        if (travelInfoCell == nil) {

            NSArray* views = [[NSBundle mainBundle] loadNibNamed:@"TravelInfo" owner:nil options:nil];

            for (UIView *view in views) {
                if([view isKindOfClass:[UITableViewCell class]])
                {
                    travelInfoCell = (TravelInfo*)view;
                }
            }
        }

        travelInfoCell.selectionStyle = UITableViewCellSelectionStyleNone;

        return travelInfoCell;
    }

}

I planed to delegate the action code to the TableViewController, but for the instant I can not even hit the breakpoint in front of the button IBAction.

Code into the TravelInfo.m and is not working and throw to me EXC_BAD _ACCESS :

- (IBAction)doAccepted:(id)sender {
    NSLog(@"accepted");
    //[delegate travelAccepted];
}

Do have any solution ?

  • 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-31T07:35:35+00:00Added an answer on May 31, 2026 at 7:35 am

    Here’s your problem:

    travelInfoCell = (TravelInfo*)view;
    

    You are not keeping a reference to the view, so there is an implicit limited life expectancy to the view variable. You’ll need to retain to keep a reference. Do this:

    travelInfoCell = [(TravelInfo*)view retain];
    

    Don’t forget to release the cell and nil it out on viewDidUnload

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

Sidebar

Related Questions

i would like to build a custom table view cell and put in him
I have built a custom UITableView with two cells. In one cell I have
I have a tableview with UITextFields to build a form. I then have a
i have a TableView with custom cells that i have built with Interface Builder.
I'm trying to build a simple TableView program struture. It seems to work fine,
I build an application and every tab-bar item contains 4 or sometimes 5 nested
I have a plain (not grouped) tableView with custom cells, and when I hit
I have a UITableView with custom cell that I have built. In each custom
I have build a grouped tableview with 2 sections. There always have to be
I am trying to build a custom table view using a cell that I

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.