iOS5的Facebook的iOS版SDK着工作和故事板
我跟着这个链接 https://developers.facebook.com/docs/mobile/ios/build/iOS5的Facebook的iOS版SDK着工作和故事板
的指令,我已经创建了一个Facebook的iOS版SDK的静态库 ,,,编译口口声声说有问题与iniWithAppId和代表方法
错误日志
2012-04-12 14:11:10.569 comman [2609:F803] - [实initWithAppId:withDelegate:]:无法识别的选择发送到实例0x68970e0
2012-04-12 14:11:10.572 comman [2609:f803] *由于未捕获异常'NSInvalidArgumentException',原因:' - [Facebook initWithAppId:withDelegate:]:无法识别的选择器发送到实例0x68970e0'
*第一掷调用堆栈: (0x13d7052 0x1568d0a 0x13d8ced 0x133df00 0x133dce2 0x209a 0x2c9d6 0x2d8a6 0x3c743 0x3d1f8 0x30aa9 0x12c1fa9 0x13ab1c5 0x1310022 0x130e90a 0x130ddb4 0x130dccb 0x2d2a7 0x2ea9b 0x1ff2 0x1f65)
终止叫做抛出exceptionsharedlibrary应用负载规则全部为
当前语言:汽车;目前Objective-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
我刚刚实现了这个昨天我自己,它完美的工作(静态Facebook库,使用故事板)。我可以看到(这将导致一个问题),唯一的区别是,你打电话:
facebook = [[Facebook alloc] initWithAppId:@"215686948531995" withDelegate:self];
和我打电话:
facebook = [[Facebook alloc] initWithAppId:@"215686948531995" andDelegate:self];
我相信使用withDelegate
代替的错误andDelegate
会给你这个错误。
static NSString* kAppId = @"yourAppId";
_facebook = [[Facebook alloc] initWithAppId:kAppId andDelegate:self];
OMG>
2012-04-14 07:57:00