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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:01:33+00:00 2026-06-05T15:01:33+00:00

I am working on adding facebook SSO and the SDK to my project. All

  • 0

I am working on adding facebook SSO and the SDK to my project. All of my main facebook code is in my AppDelegate.m and AppDelegate.h.
In my view controller [[[UIApplication sharedApplication] delegate] performSelector:@selector(callLogin)]; is called when I press a button.
The callLogin method in my AppDelegate.m looks like this:

- (void)callLogin{

facebook = [[Facebook alloc] initWithAppId:@"XXXXX" andDelegate:self];

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if ([defaults objectForKey:@"FBAccessTokenKey"] 
    && [defaults objectForKey:@"FBExpirationDateKey"]) {
    facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"];
    facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"];
}

if (![facebook isSessionValid]) {
    [facebook authorize:nil];
    }
}

Then in my - (void)fbDidLogin method I call the method setInfo which is located in my viewcontroller.

//this method is located in AppDelegate.m
- (void)fbDidLogin {
NSLog(@"FACEBOOK DID LOGIN");
ViewController * vc = [[ViewController alloc]init];
[vc setInfo]; 
}

Finally, here is my -(void)setInfo code which is located in ViewController.m

-(void)setInfo{
infoL.text = [NSString stringWithFormat: @"Connected to Facebook!"];
NSLog(@"%@",infoL);
//NSLog returns null
} 

From setInfo I am unable to change the label and NSLog returns that infoL is null. I can update the label through methods like ViewDidLoad, but not setInfo.
What am I doing wrong and how can I fix this?

  • 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-05T15:01:36+00:00Added an answer on June 5, 2026 at 3:01 pm

    The view controller won’t get updated because you just created some random instance of the class that is not on your navigation stack. I suppose you could call

     [ self.viewController setInfo ]
    

    assuming that is the property name for the vc you pushed on the stack in applicationDidFinishLaunchingWithOptions although this wouldn’t be considered great design. Id factor Facebook delegate stuff out out app delegate, create a Facebook controller singleton class that your view controller can feed off

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

Sidebar

Related Questions

I am working on adding a custom accessory view, (a button) to a UITableViewCell,
The code I'm currently working on requires adding an NSNumber object to an array.
We are working on adding some Facebook Connect functionality to our site. Part of
I've got or site working with timeline using the new javascript SDK sample code
I was working on adding dynamic controls to asp page. In the sample code,
I'm planning out adding Facebook integration to a web app I'm working on. For
So I'm working on adding some web view stuff and will eventually make this
I'm working on adding some analytics code into our e-commerce website. What I'm doing
I'm working on adding user submitted comments to a personal project. Comments have a
I am working on adding hash digest generating functionality to our code base. 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.