Search code examples
iphonexcode4facebook

Implementing Facebook Connect for iPhone using xcode 4


I'm having trouble getting Facebook Connect working. I (attempt) to follow the instructions located at http://www.mobisoftinfotech.com/blog/iphone/iphone-fbconnect-facebook-connect-tutorial/ but it seems to be for earlier versions of xcode. Here are the steps I'm taking.

  • Create a new View Based App
  • Download the SDK from their link
  • Copy the FBxxxx.h files from the FBConnect folder inside of the src folder into my projects directory
  • Create a new group named FBConnect under my project in xcode
  • right click add new files and select the files that are already within my project
  • go through the rest of the steps on the page creating an application and writing the example code

It seems that I've set everything up correct then I get the follow error when I build my project.

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_FBSession", referenced from:
      objc-class-ref in JetPackViewController.o
  "_OBJC_CLASS_$_FBLoginButton", referenced from:
      objc-class-ref in JetPackViewController.o
  "_OBJC_CLASS_$_FBRequest", referenced from:
      objc-class-ref in JetPackViewController.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

I'm assuming this has something to do with how I am importing the files into my project. So how do I fix this or what am I doing wrong?


Solution

  • The Facebook Connect SDK has been deprecated. Pull down the Facebook iOS SDK from Github. It comes with a working example and all you need to do is replace your appId in two places. If you run into issues upgrading it to Xcode 4, see this guide on upgrading.