Reputation: 19178
After integrating the Facebook SDK i get the following error immediatly after launch of the app: "unrecognized selector sent to instance"
What i did:
I setup a plain simple view controller app with XCode 6 for iOS 8.2 and integrated the Facebook iOS SDK with Cocoapods.
I worked thru the "Getting Started" Section and put the nesseccary code into AppDelegate and changed the .plist-File. When running the application, it stops immediatly with a "unrecognized selector"-Error.
I also tried out the Example-App "Scrumptious" from the Facebook-SDK, which runs very fine. I build the code from Scrumptions into my app, and stuck on the same error as before. Below i will post the callstack.
Facebook recommends the -ObjC Switch into the linker flags to solve those errors. But this Flag is already set (i think cocoapods did that already).
What can i do? What is missing?
This is the callstack:
2015-04-09 15:58:40.949 myapp[65629:2910713] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString objectForKey:]: unrecognized selector sent to instance 0x7fbd6b741140'
*** First throw call stack:
(
0 CoreFoundation 0x0000000103205a75 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000102e9ebb7 objc_exception_throw + 45
2 CoreFoundation 0x000000010320cd1d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00000001031649dc ___forwarding___ + 988
4 CoreFoundation 0x0000000103164578 _CF_forwarding_prep_0 + 120
5 myapp 0x0000000100993c66 __107+[FBSDKAppEventsUtility activityParametersDictionaryForEvent:implicitEventsOnly:shouldAccessAdvertisingID:]_block_invoke + 470
6 libdispatch.dylib 0x0000000104257614 _dispatch_client_callout + 8
7 libdispatch.dylib 0x0000000104243881 dispatch_once_f + 565
8 myapp 0x000000010099388a +[FBSDKAppEventsUtility activityParametersDictionaryForEvent:implicitEventsOnly:shouldAccessAdvertisingID:] + 1114
9 myapp 0x000000010099be4c +[FBSDKAppLinkUtility fetchDeferredAppLink:] + 780
10 myapp 0x0000000100974e6e -[AppDelegate applicationDidBecomeActive:] + 142
11 UIKit 0x0000000101bd3f96 -[UIApplication _stopDeactivatingForReason:] + 313
12 UIKit 0x0000000101be8ea2 -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:] + 2648
13 FrontBoardServices 0x0000000105b33243 __31-[FBSSerialQueue performAsync:]_block_invoke + 16
14 CoreFoundation 0x000000010313ac7c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
15 CoreFoundation 0x00000001031309c5 __CFRunLoopDoBlocks + 341
16 CoreFoundation 0x0000000103130785 __CFRunLoopRun + 2389
17 CoreFoundation 0x000000010312fbc6 CFRunLoopRunSpecific + 470
18 GraphicsServices 0x0000000103b72a58 GSEventRunModal + 161
19 UIKit 0x0000000101bd9580 UIApplicationMain + 1282
20 myapp 0x00000001009753b3 main + 115
21 libdyld.dylib 0x000000010428c145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Upvotes: 4
Views: 2701
Reputation: 12428
Have a look at your plist-File. It must contain the FacebookAppId, the DisplayName and the URL Schemes. If only one is missing, you'll get such an error.
Here is one of my apps which are working correctly with the Facebook-API:
Upvotes: 2