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

The Archive Base Latest Questions

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

i know it is a beginners question but i just couldn’t find a solution.

  • 0

i know it is a beginners question but i just couldn’t find a solution.
i have an app with a storyboard. that is a tabbed view app, and each tab leads to a nav view controller and than to a root view controller.
in the nav view controller i have a Login button. pressing it sends a message to the app delegate to handle opening a session with Facebook.
i want after the session with facebook opened, to set the title of the button to logout because thats what its going to do if i press it again.
this was all visually programmed and not hardcoded so much of the code is missing.
now i know that theres only one instance of the app delegate so its pretty easy to access it from the view, but how do i get from the app delegate to the active session of the view?
i tried putting it in viewDidLoad method but apparently the callback from the Facebook API doesn’t reload the view(as well it shouldn’t, to not work the system again for nothing)

any ideas how to get the app delegate to send a messege to the view’s activee session?

  • 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-14T13:56:47+00:00Added an answer on June 14, 2026 at 1:56 pm

    Here are a couple of ways you could do this:

    1. You could use get your app delegate to post a notification when the user is logged in/out (the Facebook library might already post notifications?), and your view controllers could register for this notification so that they can change their state when the Facebook session changes state. You’d also need to do something on your viewDidLoad method so that if the user has a session from a previous login, the controller gets itself into the correct initial state. Check out https://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Notifications/Introduction/introNotifications.html#//apple_ref/doc/uid/10000043i for more information on notification programming.
    2. You could implement code in viewWillAppear:animated on your view controller so that when the view is displayed after the user has logged in, the controller queries the app delegate to determine your session state. I suspect this is what you’re trying to do by putting the code in viewDidLoad, but the view is already loaded so this code won’t be called after a login. viewWillAppear:animated gets called just before the view appears.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that my this question may sound pathetic to you but as a
Sorry for posting such a lowly beginner's question, but I just still don't know
This may be a total beginner's question, but I have yet to find an
I know this is probably a very beginner question that I just can't seem
I know that this is supposedly a super simple question, but I've been struggling
This might be a beginners question, but I have to ask it nonetheless since
I know many have asked this question before, but as far as I can
I realize that this is probably a very basic question, but I have spent
I know this might be an extremely beginner level question but I am just
I know this is silly question but as a beginner at xcode, and i

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.