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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:05:04+00:00 2026-06-15T16:05:04+00:00

When I first read Beginning iOS 3 Development before ARC, I remember seeing patterns

  • 0

When I first read Beginning iOS 3 Development before ARC, I remember seeing patterns like this in some ViewController class:

.h
@property (nonatomic, retain) NSArray *myArray;

.m
in viewDidLoad:
NSArray *tempArray = [[NSArray alloc] init];
self.myArray = tempArray;
[tempArray release];

I remember reading that you did this so the properties could handle the memory for you if you used the property setters/getters. So now with ARC, I’m wondering if you still follow that kind of variable creation. For example, if you start a new project in iOS 6, in the AppDelegate, they do

.h
@property (strong, nonatomic) ViewController *viewController;
.m
    self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];

The temp variable is not created in this case. I was wondering why and if I should be following that pattern instead of the first one. Thanks!

  • 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-15T16:05:05+00:00Added an answer on June 15, 2026 at 4:05 pm

    They are the same pattern except now ARC properly handles the release for you. The 2nd block of code is just fine with ARC. That’s what makes ARC so nice.

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

Sidebar

Related Questions

I have this file which I need to read the first bytes to check
First let me say I have read this useful article thoroughly and am using
I'm trying to read the first line of an MP3 file (I edited this
I recently read the Head First Design Patterns book and I especially liked how
I recall when I first read Pragmatic Programmer that they suggested using scripting languages
First I've read loads of posts and sites that recommend going to http://silverlight.net/GetStarted/ to
I've read Head First Java, and I understand how OOP works. Here's my problem:
I was trying for the first time to read data from a file, a
Why is it that both outs are printing 84? The first one should read
I have to parse a file, and indeed a have to read it first,

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.