0

当将 FB 集成到我的应用程序时,它会出现并确认它已连接,但是当它返回到应用程序时它会崩溃,

这是从 fb 开发者页面返回的过程,并添加到我的视图控制器页面

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    return [[Ball_GameViewController facebook] handleOpenURL:url]; 

}

在开始的线路上有一个咨询

返回

警告:“Ball_GameViewController”可能不会响应“+facebook”

任何想法我将它引导到错误的区域。

Ball_GameViewController.h

#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
4

1 回答 1

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]; 
}
于 2012-06-24T19:16:01.060 回答