我按照此链接中的说明进行操作 https://developers.facebook.com/docs/mobile/ios/build/
我创建了一个 iOS Facebook SDK 静态库,编译器一直说 iniWithAppId 和 Delegate 方法有问题
错误日志
2012-04-12 14:11:10.569 comman[2609:f803]-[Facebook initWithAppId:withDelegate:]:无法识别的选择器发送到实例 0x68970e0
2012-04-12 14:11:10.572 comman[2609:f803] *由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[Facebook initWithAppId:withDelegate:]:无法识别的选择器发送到实例 0x68970e0”
* First throw call stack: (0x13d7052 0x1568d0a 0x13d8ced 0x133df00 0x133dce2 0x209a 0x2c9d6 0x2d8a6 0x3c743 0x3d1f8 0x30aa9 0x12c1fa9 0x13ab1c5 0x1310022 0x130e90a 0x130ddb4 0x130dccb 0x2d2a7 0x2ea9b 0x1ff2 0x1f65)
终止调用抛出异常sharedlibrary apply-load-rules all
当前语言:自动;目前客观-c
(gdb)
#import <UIKit/UIKit.h>
#import "FBConnect.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate, FBSessionDelegate>{
Facebook *facebook;
}
@property (strong, nonatomic) UIWindow *window;
@property (nonatomic, retain) Facebook *facebook;
@end
以上是我的应用程序委托标头,这是我的应用程序委托实现文件
#import "AppDelegate.h"
@implementation AppDelegate
@synthesize window = _window;
@synthesize facebook;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
facebook = [[Facebook alloc] initWithAppId:@"215686948531995" withDelegate:self];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if([defaults objectForKey:@"FBAccessTokenKey"] && [defaults objectForKey:@"FBExpirationDateKey"]){
facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"];
facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"];
}
// NSArray *permissions = [[NSArray arrayWithObjects:@"read_stream", @"publish_stream", @"offline_access", nil]retain];
if(![facebook isSessionValid]){
[facebook authorize:nil];
}
// Override point for customization after application launch.
return YES;
}
facebook 开发人员演示的方法是否仅适用于 xcode 4 或 ios 4.3?谁能给我一些建议,如何为ios5故事板编写类:3