codebear22
codebear22

Reputation: 1877

Xcode facebook connect for iphone

Hope you can help me with this errors.

  1. I've downloaded the SDK from GIT repository.
  2. I've copied the /SRC/ in my Xcode 4.2 project.
  3. I have this code on 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
    
  4. I have this code on 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];
    
    }
    
  5. My .plist file configured with my fb"HERE_MY_APP_ID"

  6. The structure of my project is
  • MyProject
    • src
    • AppDelegate.h
    • AppDelegate.m
    • MainStoryboard.storyboard
    • ViewController.h
    • ViewController.m
    • Supporting Files
  • Frameworks
  • Products

The thing is that I don't have any errors, but when I Run I got a lot of them. Almost 81, and a warning. Hope you can help me. Thanks.

enter image description here

Upvotes: 0

Views: 334

Answers (1)

Jessedc
Jessedc

Reputation: 12460

From what I can see your project is using ARC and the facebook SDK is not. It's telling you the method -release isn't available so you need to look into disabling ARC for the Facebook SDK.

Upvotes: 1

Related Questions