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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:03:50+00:00 2026-06-07T20:03:50+00:00

I just spent the last two hours slamming my forehead against my code, trying

  • 0

I just spent the last two hours slamming my forehead against my code, trying to figure out what was wrong with it. I eventually narrowed it down to one pair of lines.

NSArray *components = [string componentsSeparatedByString:@" "];

if ([components count] > 1){                        
    retainedProperty1 = [header objectAtIndex:0];

    retainedProperty2 = [header objectAtIndex:1];
}

Whenever I attempted to access either of these fields after a delay in execution (I’m using CocoaAsyncSocket, and it would pull in the rest of the data I needed for this object in a second read from the socket), they would both have become zombies. I was just wondering why the heck this was happening?

  • 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-06-07T20:03:51+00:00Added an answer on June 7, 2026 at 8:03 pm

    You’re lying to yourself. You’re saying retainedProperty1 = ... but you’re actually assigning to the ivar, not the property. Unless you’re using ARC (and you’re not or you wouldn’t have this problem), this doesn’t do any memory management whatsoever. It won’t even free the previous value of this ivar. You should be saying

    self.retainedProperty1 = ...
    self.retainedProperty2 = ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I just spent the last few hours pouring over code trying to figure
I've spent the last 2 days trying to figure this out, basically I have
I just spent the last 7 hours straight trying to find a way to
I just spent the last 4 - 5 hours trying to get the source
I've spent the past two days just trying to enable the sending of email
Ok, I spent the last 8 hours fighting with it - it just seems
I've spent the last two days trying to find a solution to this problem
Just spent a couple of hours last night developing a pretty sweet video player
I just spent the last 2 hours wondering why everything broke when I did
I just spent way too long trying to diagnose why, in the following snippet

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.