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

The Archive Base Latest Questions

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

I have spent hours on this and read everybit on the web about memory

  • 0

I have spent hours on this and read everybit on the web about memory management, zombies. leaks (tried instruments). But I cannot figure this one out. Does someone has a clue? I am getting a EXC_BAD_ACCESS at the following like of code on popping the ChildViewController.

[profileVO release]; profileVO = nil;

I strongly feel I have followed all memory management best practices!

Details:

I have a model file. (CachedProfileVO)

CachedProfileVO.h

@interface CachedProfileVO : NSObject {

   NSString *name;
   NSString *email;
}

@property (nonatomic, retain) NSString *name;
@property (nonatomic, retain) NSString *email;

@end

CachedProfileVO.m

@synthesize name, email;
- (void) dealloc
{
    [super dealloc];
    [name release]; name= nil;
    [email release]; email = nil; 
}

Now I have a UINavigationController. The ParentViewController and the ChildViewController.
I invoke the ChildViewController as follows:

[self.navigationCntroller pushViewcontroller:childViewcontroller animated:YES];

In the ChildViewController, I basically use the model CachedProfileVO. However when this view controller is popped (back button on UI), it gives a EXC_BAD_ACCESS

ChildViewController.h

@interface ChildViewcontroller : UITableViewController {
    CachedProfileVO *profileVO;  

}

@property (nonatomic, retain) CachedProfileVO *profileVO;
@end

ChildViewController.m

@synthesize profileVO;

- (void) dealloc
{
   [super dealloc];
   [profileVO release]; profileVO = nil; ****** GETTING EXE_BAD_ACCESS here
}

- (void) viewDidLoad
{
 CachedProfileVO *vo = [CachedProfileVO alloc] init];
 self.profileVO = vo;
 [vo release];

}

//responseString looks like this: [Murdoch, murdoch@email.com][other data][more data]
- (void) populateProfile:(NSString *) responseString 
{
  NSMutableString *str = [[NSMutableString alloc] initWithCapacity:20];
  [str setString:responseString];
  [str deleteCharactersInRange: NSMakeRange(0,1)];
  [str deleteCharactersInRange: NSMakeRange([str length]-1,1)];
  NSArray *tempArray = [str componentsSeparatedByString: @"]["];

  NSString *tempStr = (NSString*)[tempArray objectAtIndex:0];
  NSArray *bioArray = [tempStr componentsSeparatedByString:@","];

  self.profileVO.name = (NSString*)[bioArray objectAtIndex:0];
  self.profileVO.email= (NSString*)[bioArray objectAtIndex:1];

  [str release]; str = nil;
}

Note that the function populateProfile is called after some event. I know it is called. And dealloc then causes the problem. Also this does not happen in every pop. I have to try several times to reproduce. It is never reproduced using zombies in instruments!!!

  • 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-23T20:22:37+00:00Added an answer on May 23, 2026 at 8:22 pm

    You are calling [super dealloc]; first in your examples. That should always be the last call otherwise you are accessing instance variables that belong to a now deallocated class. The following should work fine if you followed memory management rules elsewhere.

    - (void) dealloc
    {
       [profileVO release];
    
       [super dealloc];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm really confused about this, tried to read a lot about diagrams but I
Firstly apologies if this is really simple but I have spent hours trying and
I hope this is a relatively easy problem although I have spent hours websearching
Ok so I've spent a couple hours trying to resolve this issue and have
First off, I will say i've spent 6 hours on this topic and have
I don't even want to think about how many man hours have been spent
I have spent too many hours on this and I have so far continued
I have spent 5 hours on this, and I've already been up 30 hours
I have spent hours trying to figure this problem and i just can't, so
This is probably obvious, but I'm a bit of a newbie and have spent

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.