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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:50:22+00:00 2026-05-25T10:50:22+00:00

i think i don’t finish to understand all about memory and that stuff but

  • 0

i think i don’t finish to understand all about memory and that stuff but this is my problem:

I have a variable defined idActual on a view that will be pushed (var defined in its header), i can read (NSLog(idActual)) and set it to nil without problems. BUT when i change its value i get an CFString error, that its supposed to be due to bad memory management, i’ve tried this:

i can do this: nextView.idActual = nil;

i cant do this:

a) nextView.idActual = @"1";

b) NSString *str = [NSString stringWithFormat:@"1"]; 
   nextView.idActual =  str;

c) NSString *str = [[NSString alloc] initWithFormat:@"1"];
   nextView.idActual = str;
   [str release];

a, b and c always give me the CFString error:
*** -[CFString isEqualToString:]: message sent to deallocated instance

  • 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-25T10:50:23+00:00Added an answer on May 25, 2026 at 10:50 am

    It appears that the CFString (NSString) that is contained in nextView.idActual has already been released when you go to change the value. If you can post more of the related code, that would help.

    I’m guessing that idActual is declared as @property(nonatomic,retain). When you try to set a new value into idActual, the setter method for that property is called (It’s possible that the setter was automatically generated). The first thing that the setter method is doing is trying to compare the old value and the new value – and then it crashes.

    When that setter method attempts to compare the new value to the old value, it runs into trouble because the old value is already deallocated.

    Are you calling [nextView.idActual release] before you assign these new values ? If you are, comment out that line, and see if that fixes your problem. The auto-generated setter method will release the old value for you.

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

Sidebar

Related Questions

I don't think that this could be done in C#, but posting this just
I don't think that this is doable, but wanted to throw it out to
I don't think I've seen anything that says you're not allowed to do this
I don't think this is particularly quirky, but in an attempt to control my
I don't think this is technically a macro but I don't know what else
I don't think this is possible from what I read, but is there away
I have a bug in my code that made me think I don't fully
Problem description is brief but I think I don't need to say much. When
I've tried searching for this a few times, but I just think I don't
I am new to OOP and I think I don't understand static classes. I

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.