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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:28:58+00:00 2026-05-20T03:28:58+00:00

I am facing a simple yet annoying problem of memory deallocation and message sending

  • 0

I am facing a simple yet annoying problem of memory deallocation and message sending to a freed object.

I am trying to get Rss feed from a web page. I developed the applet in 2 stages, in stage one , as i am yet new to iphone development i tried getting the text part of an Rss feed from a webpage with success and no problems. In stage 2 i tried getting the links to images and presenting them both on each UITableViewCell and the detailed view afterwards.

i have a class that loads the rss and is responsible for the parsing and the returning of the mutable array which i return through [array copy]. everything works well, even though it takes some time to load. When i Run the app and try to scroll the table view i get a crash and an NSZombie message :

objc[37372]: FREED(id): message retain
sent to freed object=0x3930cd0

and this happens also when i try to load the detailViewController without scrolling i post some of the tableViewController to see what is wrong.

- (void)viewDidLoad {
    [super viewDidLoad];
    post = [[Posts alloc]init];
    //self.tableView.rowHeight = 160.0;
    self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
    self.navigationController.navigationBar.tintColor = [UIColor purpleColor];
    NSLog(@"parser is about to init");
    parser = [[XmlParser alloc] init];
    array = [parser initWithURL:@"http://backend.deviantart.com/rss.xml?q=boost%3Apopular+meta%3Aall+max_age%3A8h&type=deviation&offset=0"];
    //array = [parser initWithURL:@"http://www.enet.gr/rss?i=news.el.categories&c=politikh"];
    NSLog(@"posts has %d items",[array count]);
    [parser release];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView  dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
        post = [array objectAtIndex:indexPath.row];
        // Set up the cell...
        [cell.textLabel text:[post itemTitle]];
        [cell.detailTextLabel setText:[post itemBody]];
        [cell.imageView setImage:[self.post itemthumbnail]];

    }
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // Navigation logic may go here. Create and push another view controller.
     FirstDetailedViewController *anotherViewController = [[[FirstDetailedViewController alloc] initWithNibName:@"FirstDetailedViewController" bundle:nil]autorelease];
    NSLog(@"posts count : %d", [array count]);
    post = [array objectAtIndex:indexPath.row];
    anotherViewController.currpost = [post retain];
    [self.navigationController pushViewController:anotherViewController animated:YES];
}

The post clash is some NSMutableStrings and UIImages, all of them are allocated and initialized in their own init and dealloced in their own dealloc method. I am also having problem when i try to tap on a cell without scrolling but that’s tommorows problem.

  • 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-20T03:28:59+00:00Added an answer on May 20, 2026 at 3:28 am

    Solved it!
    simple init problem

    Previous :

        -(id)init
    {   
        [super init];
        channelTitle = [[NSMutableString alloc]init];
        channelLink = [[NSMutableString alloc]init];
        channelDescription = [[NSMutableString alloc]init];
        channelPubDate = [[NSMutableString alloc]init];
        itemTitle = [[NSMutableString alloc]init];
        itemBody =  [[NSMutableString alloc]init];
        itemPubDate = [[NSMutableString alloc]init];
        itemLink = [[NSMutableString alloc]init];
        itemthumbnail = [[UIImage alloc]init];
        itemthumbnailLink = [[NSString alloc]init];
        itemImage = [[UIImage alloc]init];
        itemImageLink = [[NSString alloc]init];
        return self;
    }
    

    Now :

    -(id)init
    {   
        if (self==[super init]){
        channelTitle = [[NSMutableString alloc]init];
        channelLink = [[NSMutableString alloc]init];
        channelDescription = [[NSMutableString alloc]init];
        channelPubDate = [[NSMutableString alloc]init];
        itemTitle = [[NSMutableString alloc]init];
        itemBody =  [[NSMutableString alloc]init];
        itemPubDate = [[NSMutableString alloc]init];
        itemLink = [[NSMutableString alloc]init];
        itemthumbnail = [[UIImage alloc]init];
        itemthumbnailLink = [[NSString alloc]init];
        itemImage = [[UIImage alloc]init];
        itemImageLink = [[NSString alloc]init];
        }
        return self;
    }
    

    the actual image was never allocated! now it is! 😀

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

Sidebar

Related Questions

I am facing problem while trying to open a simple text file in C#.
I am facing problem with an Oracle Query in a .net 2.0 based windows
I am facing a problem with .NET generics. The thing I want to do
I'm facing a problem with IE6. I took the toggle function from this website
I am facing a problem. I would like to localize my action names in
I'm facing a real problem in understanding how to draw a variable diagram to
I'm facing a problem while unit testing my forms. The problem is that data
Good morning, I´m facing a very strange problem on which I haven´t found a
Here is the problem I am facing. I have been tasked with testing the
I'm trying to make a Simple Nested List which will be some what similar

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.