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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:16:38+00:00 2026-06-06T09:16:38+00:00

Possible Duplicate: Objective-C: With ARC, what's better? alloc or autorelease initializers? Does ARC automatically

  • 0

Possible Duplicate:
Objective-C: With ARC, what's better? alloc or autorelease initializers?

Does ARC automatically turn the autoreleased versions of class initializers into the appropriate non-autorelased versions, or are they still technically being autoreleased?

I don’t want to keep memory around any longer than it’s absolutely required, so I’ve gotten in the habit of using alloc/init in almost all circumstances. Now in ARC, I’m wondering if I can just start using the “autorelease” initializers and expect them to act like a non-autorelased versions would behave…

Does anyone have any documentation on where I can find out what happens to autoreleased methods under ARC?

  • 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-06T09:16:39+00:00Added an answer on June 6, 2026 at 9:16 am

    When you get an autoreleased object, ARC will manage to avoid the autorelease pool, as long as both your code and the called method/function are compiled with ARC.

    ARC adds a call to objc_retainAutoreleasedReturnValue in your code and a call to objc_autoreleaseReturnValue in the called function/method. At runtime when objc_autoreleaseReturnValue sees that the returned value will be retained by objc_retainAutoreleaseReturnValue, it doesn’t autorelease the object and sets a flag to tell objc_retainAutoreleaseReturnValue not to retain the object. Thus you get no (perceptible) extra cost for using a convenient creation method rather that alloc/init.

    For more information about that mechanism, you may read How does objc_retainAutoreleasedReturnValue work? by Matt Galloway.

    In conclusion, just use the method you prefer, Apple engineers will ensure it runs fast.

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

Sidebar

Related Questions

Possible Duplicate: Does fast enumeration in Objective-C guarantee the order of iteration? Just a
Possible Duplicate: What does ^ in objective C mean? [SKSite requestSiteWithNameLike:@Stack Overflow completionHandler:^(SKSite *site,
Possible Duplicate: Does Objective-C guarantee the initialization of interface member data? When I declare
Possible Duplicate: Caret in objective C What does this ^ syntax mean in Objective-C?
Possible Duplicate: Writing into a file objective c How do I create and write
Possible Duplicate: Objective C multiple inheritance Hi, Objective C does not support multiple inheritance.
Possible Duplicate: Objective C alloc/release error When I try the code below it crashes
Possible Duplicate: Creating an abstract class in Objective C Hi Can any one please
Possible Duplicate: How do I convert a string into an integer in objective C?
Possible Duplicate: objective-c : @synchronized, how does it work? when i have three methods:

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.