简体   繁体   中英

facebook SDK error in iOS

I followed the tutorial exactly as is in the developers.facebook.com but when I press login I get a SIGABRT error. The debugger shows:

[SixthViewController login:]: unrecognized selector sent to instance 0x8476230
2012-08-19 15:56:35.710 pyxida3[21363:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SixthViewController login:]: unrecognized selector sent to instance 0x8476230'
*** First throw call stack:
(0x256c022 0x1c7fcd6 0x256dcbd 0x24d2ed0 0x24d2cb2 0x256de99 0xde514e 0xde50e6 0xe8bade 0xe8bfa7 0xe8b266 0xe0a3c0 0xe0a5e6 0xdf0dc4 0xde4634 0x1f46ef5 0x2540195 0x24a4ff2 0x24a38da 0x24a2d84 0x24a2c9b 0x1f457d8 0x1f4588a 0xde2626 0x280d 0x2775)
terminate called throwing an exception(lldb) 

this is the method called

- (IBAction)authButtonAction:(id)sender {
AppDelegate* appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
// The user has initiated a login, so call the openSession method
// and show the login UX if necessary.
[appDelegate openSessionWithAllowLoginUI:YES];

}

Can anyone help?

Apparently, you are calling login on your SixthViewController somewhere, and this method is not defined on that viewController class. Please check where in your code you are doing the login call. You are probably expecting another instance there(maybe your app delegate on which you defined a login method?), but in reality, the instance points to a SixthViewController instance.

Like OhhMee posted, a code snippet showing the login call could shed more clarity.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM