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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:07:24+00:00 2026-05-31T21:07:24+00:00

info: xcode 4.3.2, iOS5, using storyboard. Created project from xcode’s Tabbed Application template. Did:

  • 0

info: xcode 4.3.2, iOS5, using storyboard.

Created project from xcode’s “Tabbed Application” template.
Did:

@implementation SUSecondViewController
UIImagePickerController *pic;

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    pic = [[UIImagePickerController alloc] init];
    pic.delegate = self;
   // [pic setSourceType:UIImagePickerControllerSourceTypeCamera];
    [self presentModalViewController:pic animated:YES];
}

When I click the tab the first time, the camera app is displayed.
When I click the tab the second time, the default view from the template is displayed, however I want the camera to be displayed every time the tab is clicked.

How can I make the camera appear every time I click a specific tab (with f.ex. a camera icon) ?

  • 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-31T21:07:25+00:00Added an answer on May 31, 2026 at 9:07 pm

    viewDidLoad only happens when the view is loaded.

    If a view disappears / reappears it’s not guaranteed that the view will get unloaded / loaded.
    Maybe because there still is a strong pointer to the viewController somewhere, and the system doesn’t need to free up some memory.

    If you want to get it called every time the view appears, place that code in UIViewControllers

    - (void)viewDidAppear
    

    method instead of

    - (void)viewDidLoad
    

    You might also want to take a look here:
    http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/ViewLoadingandUnloading/ViewLoadingandUnloading.html#//apple_ref/doc/uid/TP40007457-CH10-SW1

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

Sidebar

Related Questions

info: iOS5, xcode4.3.2, iphone5 Create tab view controller application from xcode template wizard. Following
I have started a project in Xcode 3.x using the Create a Window-Based Application
I am quite new to Xcode coding and I have been using Storyboard for
I am using an info.plist in Xcode to set the Environmental Variables, DYLD_LIBRARY_PATH and
An XCode 3.X application running on 10.6.8 has this entry in info.plist: <key>CFBundleVersion</key> <string>2035</string>
in a XCode project, I offen got xcodeproject/project.pbxproj file changed, but useless info for
As we know, in xcode 3, there is a custom location in project info.
In Xcode 3.2 in INFO.PLIST we have option application does not run in back
I am using XCode to build an iPhone application, where I would like to
When I select the executable in the Xcode project interface, an Info window comes

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.