Question

I am following this tutorial to add Facebook login to my iPhone app.

However, when I add [FBLoginView class]; to didFinishLoadingWithOptions in my AppDelegate.m, I get the following error:

Use of undeclared identifier: 'FBLoginView'

To my knowledge I have added the SDK properly including everything listed here.

The whole code looks like this:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Makes various cosmetic changes
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
    [[UINavigationBar appearance] setBarTintColor: UIColorFromRGB(0x007aff)];
    [[UINavigationBar appearance] setTintColor: [UIColor whiteColor]];
    [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];
    // The code that FB told me to add
    [FBLoginView class];
    return YES;
}
Était-ce utile?

La solution

You need to import facebook SDK. use this line in AppDelegate.h.

#import <FacebookSDK/FacebookSDK.h>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top