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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:32:42+00:00 2026-05-31T05:32:42+00:00

Question #1 Will NSStringFromCGPoint() return an autorelease object or does the object needs to

  • 0

Question #1
Will NSStringFromCGPoint() return an autorelease object or does the object needs to be released?

Question #2
When you have a property : @property (nonatomic, retain) NSString *someString;
And you set it like so: self.someString = [[[NSString alloc] initWithString:@”Something”] autorelease];

Is this:

[someString release];
someString = nil;

equal to

self.someString = nil;
  • 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-31T05:32:43+00:00Added an answer on May 31, 2026 at 5:32 am
    1. I haven’t checked that one specifically, but by convention those sorts of functions return autoreleased objects. You might be able to test this yourself by setting up a minimal, non-ARC project and calling -retainCount on what you get out of the function, but I’m not sure. (And in general, retainCount isn’t something you want to use.)

    2. Yes. The synthesized setter looks something like:

      - (void)setSomeString:(NSString *)string
      {
          if (string != someString) {
              [someString release];
          }
          someString = [string retain];
      }
      

    So, whether you call it explicitly or using the dot notation, the old value gets released (and the underlying ivar gets set to nil or whatever you pass in).

    Also, I’m not sure if you were just doing it for a random example, but you don’t have to wrap a string literal in memory management code to pass it to the property accessor. (That is, self.someString = @"Something" is fine.)

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

Sidebar

Related Questions

This is confusing me, so this question will probably be confusing. I have a
We have a table with, say, 5 indices (one clustered). Question: will it somehow
This question will sound like a newbie but i have gone through all threads
I have question will the click event or any other event run in document.ready()
I'm new to CodeIgniter and I hope that my question will have a simple
I'm making a flash quiz which will have a series of questions. Each question
Pretty simple question: will the result of b2Body::GetLinearVelocity tell me if an object is
I have a really strong feeling that this question will either be closed or
The question will best be understood with an example. I have Hospital One who
My question will probably be best explained by an example. For example, I have

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.