我嘗試將facebook api集成到我的應用程序中以發佈到牆上。 現在我在我的appdelegate集成代碼,但我不知道在這行收到此errore: 「initWithAppId:未找到」facebook集成iphone
AppDelegate.h
#import <UIKit/UIKit.h>
#import "FBConnect.h"
#import "Facebook.h"
@interface AppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate> {
UIWindow *window;
UITabBarController *tabBarController;
Facebook *facebook;
}
@property (retain, nonatomic) IBOutlet UIWindow *window;
@property (retain, nonatomic) IBOutlet UITabBarController *tabBarController;
@property (retain, nonatomic) Facebook *facebook;
AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self.window addSubview:self.tabBarController.view];
facebook = [[Facebook alloc] initWithAppId:@"168377643283604"];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if ([defaults objectForKey:@"FBAccessTokenKey"] && [defaults objectForKey:@"FBExpirationDateKey"]) {
facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"];
facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"];
}
[self.window makeKeyAndVisible];
return YES;
}
你剛複製和粘貼的地方這個代碼? – 2012-03-27 08:53:53