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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:26:25+00:00 2026-06-04T15:26:25+00:00

I want my app to be loaded on the same view every time it

  • 0

I want my app to be loaded on the same view every time it is fully loaded out of memory, so when the app is closed and then opened again, it opens the same view (currently it’s one of the tabs in UITabBar).
I’d like to see code, not just description on how to do this, because I’m not very experienced in the iOS development.
Thanks in advance!

  • 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-04T15:26:27+00:00Added an answer on June 4, 2026 at 3:26 pm

    If your tab is a main menu, for example, that you always want to be loaded when the app is run, then consider not allowing multitasking by adding the following key in your app’s Info.plist file:

    Application does not run in background - (tick the box)
    or:
    UIApplicationExitsOnSuspend - set to YES (BOOL)
    

    This will ensure that your app quits when the home key is pressed and the UIApplicationDelegate method applicationwillterminate: is called.

    EDIT:

    Okay, I think you need to keep track of your particular tab and/or the tab that the user is on, whenever this changes. Save this value in NSUserDefaults (plist) and check it each time the app starts up or becomes active – then you can switch to that tab if it’s not onthe correct one.

    Is this what you are trying to do?

    EDIT 2:

    First step, wherever you listen out for button presses on your tab bar, you need to grab the integer value of the new selected index, like in the accepted answer here:

    Switching to a TabBar tab view programmatically?

    Then, you need to write this value (store/save it) to a .plist file. First, add a new property list file to your project, then open it in Xcode and add a new row, call it something simple like SelectedTab with a type of Number and say a value of 1337.

    In your app delegate, you need to tell your app that you have a new .plist that you need to be registered with the app, so in application:didFinishLaunchingWithOptions: you need to do the following:

    NSUserDefaults* userPreferences = [NSUserDefaults standardUserDefaults];
    [userPreferences registerDefaults: [NSDictionary dictionaryWithContentsOfFile: [[NSBundle mainBundle] pathForResource: @"myNewFile" ofType: @"plist"]]];
    

    Here’s how you can read and write to your SelectedTab plist integer:

    To get the stored value…

    int test = [[NSUserDefaults standardUserDefaults] integerForKey: @"SelectedTab"];
    

    To write a new value to your key…

    int newTab = 2;
    [[NSUserDefaults standardUserDefaults] setInteger: newTab forKey: @"SelectedTab"];
    [[NSUserDefaults standardUserDefaults] synchronize]; // absolutely critical!
    

    You just need to pick the right place in your app delegate to perform this check, and then tell your tab bar to load the tab you want.

    Hope this helps!

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

Sidebar

Related Questions

I want to make an app which (amongst other things) can parse feeds loaded
I am working on a view based app in iphone, i want to show
I want my app to display measurements in US or Metric based on the
I want my app to catch downloads of a particular kind of file. Here's
I want my app to have a specific layout for Android tablets and another
I want my app (AIR app ported on iOS) to be able to show
I want my app to be able to tell whether a call was missed,
I am new android app developer i want make app for tablets and phone
For example, the users of our app want to search products by entering a
I'm writing a JNI application and I want the app to download the correct

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.