希望你能帮我解决这个错误。
我在AppDelegate.h上有这段代码
#import <UIKit/UIKit.h> #import "FBConnect.h" @class ViewController; @interface AppDelegate : UIResponder <UIApplicationDelegate,FBSessionDelegate> { Facebook *facebook; } @property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) ViewController *viewController; @property (nonatomic, retain) Facebook *facebook; @end
我在AppDelegate.m上有这段代码
#import "AppDelegate.h" #import "ViewController.h" @implementation AppDelegate @synthesize window = _window; @synthesize viewController = _viewController; @synthesize facebook; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window.rootViewController = self.viewController; [self.window makeKeyAndVisible]; facebook = [[Facebook alloc] initWithAppId:@"HERE_APP_ID" andDelegate:self]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; if ([defaults objectForKey:@"FBAccessTokenKey"] && [defaults objectForKey:@"FBExpirationDateKey"]) { facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"]; facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"]; } if (![facebook isSessionValid]) { [facebook authorize:nil]; } return YES; } - (BOOL) application:(UIApplication *)application handleOpenURL:(NSURL *)url { return [facebook handleOpenURL:url]; } -(void) fbDidLogin { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject:[facebook accessToken] forKey:@"FBAccessTokenKey"]; [defaults setObject:[facebook expirationDate] forKey:@"FBExpirationDateKey"]; [defaults synchronize]; }
我的.plist文件配置了我的fb“HERE_MY_APP_ID”
- MyProject的
- SRC
- AppDelegate.h
- AppDelegate.m
- MainStoryboard.storyboard
- ViewController.h
- ViewController.m
- 支持文件
- 框架
- 产品
问题是我没有任何错误,但是当我跑步时我得到了很多错误。差不多81,还有一个警告。希望您能够帮助我。感谢。
答案 0 :(得分:1)
从我所看到的,您的项目使用的是ARC,而facebook SDK则没有。它告诉您方法-release
不可用,因此您需要考虑为Facebook SDK禁用ARC。