问题
First time posting.
Just downloaded the FB iOS SDK yesterday (10/10/2012)
I have gone through the Getting Started steps listed at https://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/3.1/
I'm trying to call [FBRequest requestForMe]
As a part of this test code
if (FBSession.activeSession.isOpen)
{
[[FBRequest requestForMe]startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) {}];
}
The test code is implemented inside of an existing project. The code compiles/builds fine; there are no linker errors. It is within a viewDidAppear method inside of a viewcontroller that is opened with a button press.
I am getting this runtime error on the [FBRequest requestForMe] call: [FBRequest requestForMe]: unrecognized selector sent to class 0x667bb0 0x667bb0 is FBRequest.
I'm sure there's more information I could give, I'm not sure what else would help. Let me know and I'll reply.
Question: What would make the requestForMe selector be unrecognized, knowing that compiling and linking doesn't complain about that line at all?
回答1:
So, great first post on my part... The legacy code I was working on had a previous implementation of Facebook. It already had a FBRequest.h/m. Somehow the linker got confused but never yelled at me?
I removed the old FBRequest files from the build target and all is well now. Thanks for reading!
来源:https://stackoverflow.com/questions/12847953/fbrequest-requestforme-unrecognized-selector