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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T08:17:02+00:00 2026-05-17T08:17:02+00:00

I create/push my ViewController, display some informations and navigate back to my RootViewController. While

  • 0

I create/push my ViewController, display some informations and navigate back to my RootViewController. While I navigate back the app crashes (EXC_BAD_ACCESS).

With Instruments I found out that the dealloc of my ViewController is called, which releases my wrapper class. In my wrapper class also the dealloc method is called. This dealloc releases parsedJson (retained property) and right then the app crashes. It is strange that the retain count drops from 1 to -1 despite only a malloc and a release has been made.

If I retain the returned result parsedJson, the app doesn’t crash and I don’t find a leak.

SBJsonParser *JSONParser = [SBJsonParser new];
id parsedJson = [[JSONParser objectWithString:jsonString error:NULL] retain];

I can’t make a release/autorelease because then the app would crash again.

With NSZombieEnabled I get

* -[CFDictionary release]: message sent to deallocated instance 0x6d51aa0

I get this Zombie after I made a change. Before I used a property and Interface Builder for my view controller and I didn’t got a crash, because the view controller wasn’t released immediately. Now I’m doing this:

MyViewController *myViewController = [[MyViewController alloc] init];
[[self navigationController] pushViewController:myViewController animated:YES];
[myViewController release];
myViewController = nil;

Where is the error? I cannot retain parsedJSON without a release. I’m never releasing parsedJson except of the dealloc. Has the used library an error in it?

  • 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-17T08:17:02+00:00Added an answer on May 17, 2026 at 8:17 am

    [JSONParser objectWithString:] returns an auto-released object. If you want to keep it around, you must retain it – and only at that point do you become responsible for releasing it. But if you didn’t retain it, then don’t keep it around and don’t release it.

    You said you were using a retain property, but did you actually use the property (self.ivar = object) or did you access the variable directly (ivar = object)? The object will only be retained if you use the property.

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

Sidebar

Related Questions

First thing i do is create a ViewController and push it to the Navigation
Usually when we push viewcontroller, we will create object for view controller, after that
How can i create a chain of viewcontrollers and push them into navigation item
I create push origin 'my branch' to github repo. Now, as I understand on
I'm trying to create a AJAX push implementation in PHP using a Comet long-polling
Am trying to create a java project which can able to send push notification
I will create multiple sale versions of the same application with push notifications feature:
I'm trying to create an array from selected table rows so I can push
These are my steps to create a remote git repository and push to it
I am trying to create the subroutine mypush with similar functionality of inbuilt push

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.