I just did this:
in the file YourApp_AppDelegate.h
#import "FBConnect.h" Facebook *facebook; @property (nonatomic, retain) Facebook *facebook;
In the program YourApp_AppDelegate.m
@synthesize facebook;
Then in your application didFinishLaunchingWithOptions: function:
facebook = [[Facebook alloc] initWithAppId:@"YOUR_FACEBOOK_API"];
From your viewController.h (any of them),
#import "YourApp_AppDelegate.h" YourApp_AppDelegate *appDelegate;
And then in your function viewController.m viewDidLoad:
appDelegate = (YourApp_AppDelegate *)[[UIApplication sharedApplication] delegate];
Now, anytime you want to link to your Facebook singleton, just refer to it like this:
[appDelegate.facebook authorize:nil delegate:self]
source share