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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:56:45+00:00 2026-06-12T19:56:45+00:00

I have two scenario for the project with ARC and project without ARC. 1)

  • 0

I have two scenario for the project with ARC and project without ARC.

1) The project without ARC.we can use the following.

 MyViewController* viewController = [[MyViewController alloc] init];
 [self.navigationController pushViewController:viewController animated:YES];
 [viewController release];

2)How can I achieve the above in the project which is with ARC.

      a)where can I allocate memory?
      b)where can I release viewcontroller after pushing?
      c)is there any standard for it?
  • 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-12T19:56:46+00:00Added an answer on June 12, 2026 at 7:56 pm

    When using ARC you do not need to release the viewController, the compiler will add the release and retain for you..

    So in ARC this will do:

    MyViewController* viewController = [[MyViewController alloc] init];
    [self.navigationController pushViewController:viewController animated:YES];
    

    Using retain, release and autorelease will result in a compiler error.


    Be aware that you will need to use the @property correctly when using ARC. Use strong for properties that you want to retain and weak for properties that you just want to assign. If you want iOS 4.3 support you can’t use weak but should use unsafe_unretained.

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

Sidebar

Related Questions

Scenario I have two WCF Services combined in a single App.Config file. I can't
Assume the following scenario. I have two files A.cpp and B.cpp in trunk. At
Consider this scenario: I have a project with two modules and one common module
The following scenario came up in our project: We have hierarchical business objects. The
Scenario: I have a project containgin two C# projects, which for historical reasons must
I have the following scenario: Project A contains 2 interfaces A, and B and
I have the following scenario: Program P (can take upto 30 minutes to complete)
My scenario is I have two laptops with fresh installation of windows . Now
I have scenario, I have two update panels on the page (both have update
The scenario is I have two div s: one is where I select items

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.