将FB集成到我的应用程序时会出现并改变其连接状态,但是当它返回到应用程序时会崩溃,
这是来自fb开发者页面的返回过程,并将其添加到我的视图控制器页面
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
return [[Ball_GameViewController facebook] handleOpenURL:url];
}
在该行开始时有一条建议
返回
说
警告:'Ball_GameViewController'可能无法响应'+ facebook'
我有任何想法将它指向错误的区域。
#import <UIKit/UIKit.h>
#import "FBConnect.h"
@interface Ball_GameViewController : UIViewController <FBSessionDelegate, FBDialogDelegate>
{
Facebook *facebook;
}
@property (nonatomic, retain) Facebook *facebook;
@property (nonatomic, retain) IBOutlet UIWindow *window;
- (IBAction)facebookpost;
- (IBAction)start;
- (IBAction)reset;
- (void)countdown;
- (void)scorecount;
- (void)checkTime;
@end
答案 0 :(得分:3)
在 Ball_GameViewController
@interface
中,您需要使用:
@property (nonatomic, strong) Facebook * facebook;
在 Ball_GameViewController
@implementation
中,您需要@synthesize facebook;
试试这个:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
Ball_GameViewController * ballGame = [[Ball_GameViewController alloc] init];
return [[ballGame facebook] handleOpenURL:url];
}