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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:21:05+00:00 2026-05-26T05:21:05+00:00

I have the following: Class Number1 .h file: myAudiCiviliteInputViewController *civiliteInputViewController; .m file: – (void)tableView:(UITableView

  • 0

I have the following:

Class Number1

.h file:

myAudiCiviliteInputViewController *civiliteInputViewController;

.m file:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableViewEtape4 deselectRowAtIndexPath:indexPath animated:NO];

    civiliteInputViewController = [[myAudiCiviliteInputViewController alloc] init];
    [self.navigationController pushViewController:civiliteInputViewController animated:YES];
    [civiliteInputViewController release];

    UIButton* customView = [UIButton buttonWithType: UIButtonTypeInfoLight];
    [customView setFrame:CGRectMake(0, 0, 60, 31)];
    [customView setImage:[UIImage imageNamed:@"nc_btn_ok.png"] forState:UIControlStateNormal];
    [customView addTarget:self action:@selector(okPressed) forControlEvents:UIControlEventTouchDown];
    UIBarButtonItem *envoyerButton = [[UIBarButtonItem alloc] initWithCustomView: customView];
    [self.navigationController.navigationBar.topItem setRightBarButtonItem:envoyerButton];
    [customView release];

}

-(void) okPressed{

        self.civiliteString= civiliteInputViewController.civiliteInputString;
        civiliteLabel.text = self.civiliteString;

        [self.navigationController popViewControllerAnimated:YES];
}

When I click the tableView I move onto class Number 2.

Class Number2 myAudiCiviliteInputViewController

@synthesize civiliteInputString;

- (void)dealloc
{
    [civiliteInputString release];
    [tabelViewCivilite release];
    [tableViewArray release];
    [super dealloc];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.

    tableViewArray = [[NSMutableArray alloc] initWithObjects:@"Madame", @"Mademoiselle", @"Monsieur", nil];

}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CellRecherchePartenaires"];

    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"CellRecherchePartenaires"] autorelease];

                    }
    // Set up the cell...
    [[cell textLabel] setText: [tableViewArray objectAtIndex:indexPath.row]] ;

    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tabelViewCivilite deselectRowAtIndexPath:indexPath animated:YES];
    UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath];
    self.civiliteInputString = selectedCell.textLabel.text;

    [tableView  reloadData];

}

When I go from Class Number1 to Class Number2 it works. When I come back from Class Number2 to Class Number1 I get EXC_BAD_ACCESS in Class Number2, at this line:

[super dealloc];

Any ideas why?

  • 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-26T05:21:06+00:00Added an answer on May 26, 2026 at 5:21 am

    Looking at your code. UIButton* customView is autoreleased. Remove -> [customView release]

    UIButton* customView = [UIButton buttonWithType: UIButtonTypeInfoLight];
    [customView setFrame:CGRectMake(0, 0, 60, 31)];
    [customView setImage:[UIImage imageNamed:@"nc_btn_ok.png"] forState:UIControlStateNormal];
    [customView addTarget:self action:@selector(okPressed) forControlEvents:UIControlEventTouchDown];
    UIBarButtonItem *envoyerButton = [[UIBarButtonItem alloc] initWithCustomView: customView];
    [self.navigationController.navigationBar.topItem setRightBarButtonItem:envoyerButton];
    [customView release]; // Remove this line
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following class public class ButtonChange { private int _buttonState; public void SetButtonState(int
I have the following two class: //file FruitTree.h @interface FruitTree : NSObject { Fruit
Hi I have following which is not generating class file for complextypes using bindigs.xml
I currently have the following code: public class Count { public static void countChar()
I have the following controller file: <?php class Test extends CI_Controller { function __construct()
I have following class (as seen through reflector) public class W : IDisposable {
I have following simple class: @interface Article: NSObject { NSString *title; } @property (copy,
I have following code class User attr_accessor :name end u = User.new u.name =
I have following event class. I have a question related to the Property method
I have following test class @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = {/services-test-config.xml}) public class MySericeTest { @Autowired

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.