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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:32:23+00:00 2026-06-11T06:32:23+00:00

Dear fellow iOS developers, I’m still developing without ARC (switching coming soon) and after

  • 0

Dear fellow iOS developers,

I’m still developing without ARC (switching coming soon) and after an interesting discussion with a iOS beginner, I’ve presented my way to initialize a retain property (let’s call it property), that I inherited from Apple docs at their pre-ARC era:

NSObject *tmpProperty = [[NSObject alloc] init];
self.property = tmpProperty;
[tmpProperty release];

I see a great benefit with this: it makes memory management clear.

There’s also a great drawback: it takes 3 lines, for something very basic. So we assumed: why not the following solution?

self.property = [[[NSObject alloc] init] autorelease];

It’s less clear about memory management but much more compact (and it propably make the ARC-migration easier to achieve).

What are (were?) you using yourself? Do you think one of these is a clearly better solution than the other?

  • 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-11T06:32:25+00:00Added an answer on June 11, 2026 at 6:32 am

    Using autorelease is never a great option, as you have no control over the lifetime of the object you are initializing, so it may be the case that

    In a ViewController you have initialized some object e.g. property, and you are swtiching to some other views, and if you want to come back to the older ViewController and access the object, it might be released by the iOS, and your app might crash.

    I think switching to ARC at the earliest would be your best option. I think ARC should be used by every developer, almost all the devices are being provided by the iOS5 update, so there might be least chances of supporting older devices.

    Hope this solves your doubt

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

Sidebar

Related Questions

Dear fellow homo sapiens, I've created this graph using the code below (except without
Dear Fellow Android Developers! EDIT: Thank you all for your answers. I see from
Dear fellow readers on Stack Overflow, I am currently working in CSS and I
Dear members of the Stackoverflow community, We are developing a web application using the
Dear fellow programmers, I am working on my B&B's website www.bordemundo.com and would like
dear i have a datepicker inside my form. after i click the textfield, datepicker
dear all..i've a textfield, it using barcode scanner for input data..after scan it shows
Dear iPhone Developers, I am writing a Navigation based iPhone application. I want to
dear fellow programmers! I'd really appreciate a few answers or hints concerning following problem:
Dear fellow programmers, Recently me and my partner have developed an application for the

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.