I followed the example SSO on Facebook's developer website but am getting a strange warning message when I call the authorize message:
- (BOOL)application:(UIAp开发者_如何学Goplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[_window makeKeyAndVisible];
facebook = [[Facebook alloc] initWithAppId:@"(my app's ID number)"];
[facebook authorize:nil delegate:self];
//[_window addSubview:viewController.view];
//[[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES];
return YES;
}
The second line shows up with the warning: "Sending QueryTestingAppDelegate to parameter of incompatible type 'id'.
The project builds and runs, but won't do anything Facebook-related.
(I do have the correct App ID # filled in in the code).
In the AppDelegate header file, did you ensure it implemented the FBSessionDelegate protocol?
i.e.
#import "FBConnect.h"
@interface QueryTestingAppDelegate : NSObject <UIApplicationDelegate, FBSessionDelegate>
The Facebook documentation isn't terribly clear on this point but I think that should fix the warning.
精彩评论