6

I am using this link. But I am really stuck here, and i am getting 20 errors of duplicity and redefinition.

It happens when I replaced facebookSDK/FacebookSDK.h to Facebook.h . Before that as said in the tutorial I include a folder "Deprecated header" from Facebook sdk.

According to this Facebook tutorial:

Step 2: Sending the request

To invoke the Facebook dialogs you must reference the Facebook deprecated headers. The headers can be found here ~Documents/FacebookSDK/FacebookSDK.framework/Versions/A/DeprecatedHeaders. Drag the whole DeprecatedHeaders folder and deselect the "Copy items into destination group's folder (if needed)" option to add the headers as a reference.

Now you can make the required code changes. In your app delegate import the Facebook.h header file and replace the Facebook framework <FacebookSDK/FacebookSDK.h> import declaration:

#import "Facebook.h"

This will allow you to make call to the FBDialog classes. The Facebook.h header includes the <FacebookSDK/FacebookSDK.h> header files. If you have any problems with Xcode recognizing the Facebook.h file just close and reopen your Xcode project.

In the app delegate header file, declare a property that will hold the Facebook instance:

@property (strong, nonatomic) Facebook *facebook;

In the app delegate implementation file, synthesize the Facebook property:

@synthesize facebook = _facebook;

As soon as I do this, I get errors and not able to compile.

halfer
  • 19,824
  • 17
  • 99
  • 186
YogiAR
  • 2,207
  • 23
  • 44
  • just make sure you are using latest facebook sdk 3.1 to integrate the facebook to your app , check out this http://developers.facebook.com/features/whats-new-ios-sdk-3.1/ – Singh Oct 10 '12 at 06:29
  • Hi , I am using the latest version of facebook sdk .. but now i think that if its not working then i should prefer old one ... – YogiAR Oct 10 '12 at 06:34

1 Answers1

11

solved it finally.

I removed errors using following steps:

i replaced #import "FacebookSDK/FacebookSDK.h" with #import "FBSession.h" everywhere in my project. And other thing i Only used #import "facebook.h " in Appdelegate.h. This solved the error for me and i did nothing extra

Hope this would help someone here

YogiAR
  • 2,207
  • 23
  • 44
  • 2
    Actually, simply replacing the import for `` by `"Facebook.h"` does the trick, no need to include `FBSession.h` separately. – Pascal Bourque Nov 19 '12 at 21:16
  • 1
    @rakesh: Please elaborate your answer. I'm facing the same issue and replacing the import for by "Facebook.h" doesn't do the trick for me. – aToz Nov 20 '12 at 09:57
  • 1
    i replaced #import "FacebookSDK/FacebookSDK.h" with #import "FBSession.h" everywhere in my project. And other thing i Only used #import "facebook.h " in Appdelegate.h. This solved the error for me and i did nothing extra. Let me know if this helps you – YogiAR Nov 21 '12 at 12:16
  • Sorry for the delayed reply. Thanks a lot for your help. It worked wonders. Cheers! – aToz Dec 06 '12 at 20:47