首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在新的facebook-ios-sdk中没有initWithAppId方法

在新的facebook-ios-sdk中没有initWithAppId方法
EN

Stack Overflow用户
提问于 2011-10-25 00:54:13
回答 1查看 948关注 0票数 3

我正在开发脸书的iOS应用程序。我遇到的问题是没有方法initWithAppID,只有initWithAppID andDelegate:,但我不想在初始化对象时指定委托,因为我是在我的appDelegate和<FBRequestDelegate>中这样做的,即将在我的UIView子类中实现。

所以我的问题是:在哪里初始化Facebook对象更好,在andDelegate:中设置什么更好?

会很感激你的回答,

Artem

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-10-25 00:59:07

FBSessionDelegate上的所有方法都被标记为可选的,因此您应该能够将nil作为委托传递。

代码语言:javascript
复制
/**
 * Your application should implement this delegate to receive session callbacks.
 */
@protocol FBSessionDelegate <NSObject>

@optional

/**
 * Called when the user successfully logged in.
 */
- (void)fbDidLogin;

/**
 * Called when the user dismissed the dialog without logging in.
 */
- (void)fbDidNotLogin:(BOOL)cancelled;

/**
 * Called when the user logged out.
 */
- (void)fbDidLogout;

@end

Facebook类将委托作为已分配的属性,因此您可以稍后设置它。

代码语言:javascript
复制
@property(nonatomic, assign) id<FBSessionDelegate> sessionDelegate;
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7879061

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档