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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:36:09+00:00 2026-05-30T23:36:09+00:00

I have an UIViewController with scalar ivars. I would like to know what will

  • 0

I have an UIViewController with scalar ivars. I would like to know what will happen when a controller will receive a memory warning.

testBool will be kept without changes or will be reseted ?

class.h

@interface myView : UIViewController
{
BOOL testBool;
}
  • 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-30T23:36:09+00:00Added an answer on May 30, 2026 at 11:36 pm

    When you receive a memory warning, YOU need to react to it. The system will try to help you (freeing VC’s views and calling loadView / viewDidLoad again when needed) but you need to take care of all your objects.

    Speaking of objects.. if you define “BOOL*” this will be a pointer.. i don’t think you really want this (you will need to allocate some memory and assign this memory address to testBool so you can access the real scalar value with *testBool = YES/NO and free this memory on [self dealloc]).

    In general, cocoa memory management applies to OBJECTS only. If you mess around with pointers to scalars you have to deal yourself with memory (de)allocation. You should use scalar ivars or Foundation-Types like NSNumber. If you use ARC, you don’t even have to care a lot about the memory management (retain/release). Only when you receive memory warnings, you should assign nil to the variables (ARC will handle the memory management).

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

Sidebar

Related Questions

Here is the situation, I have UIViewController class with a UITableView outlet. I would
I have an UIViewController with a button. Now when i will press that button
I have a UIViewController which presents a modal view controller and when I rotate
I have a UIViewController (MyViewController) and another view controller i'm presenting modally though MyViewController
I have a UIViewController one UIWebView in it. I'd like the UIWebView to be
I have a UIViewController which is embedded in a navigation controller and presented modally:
I have a UIViewController residing in a UINavController. The view controller which is playing
I have a UIViewController inside of a navigation based app. I'd like the view
I have a UIViewController that I've added UITableViewDelegate to. This controller has a corresponding
I have an UIViewController, this controller is contained in a navigationController. I add an

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.