简体   繁体   中英

SIGABRT error in Facebook iOS SDK 3.0 Tutorial

I am trying to complete the tutorial for the iOS SDK 3.0 from Facebook and I have an error in my main.m file.

The error says "Thread 1: Signal SIGABRT" on the "return" statement. This error pops up when I click the "login" button of my app when it initiates the Facebook Login Flow.

#import <UIKit/UIKit.h> 
#import "MMAppDelegate.h" 
int main(int argc, char *argv[]) {     
         @autoreleasepool 
         { return UIApplicationMain(argc, argv, nil, NSStringFromClass([MMAppDelegate class])); } }

For reference here is the link to the Facebook tutorial that I am following: http://developers.facebook.com/docs/tutorials/ios-sdk-tutorial/

Thanks so much - this error is a total drag.

It probably has nothing to do with main. One of the things about Xcode that is kind of dumb is that regardless of where the exception occurred, it will always report main as the cause.

A good trick in Xcode is to open the left navigator area and click the Breakpoint Navigator to get a list of your project's breakpoints. Then in the bottom left corner there is a + symbol. Click that and say "Add Exception Breakpoint". Make sure "All" and "On Throw" are selected and press "Done". This will cause the program to break at the actual line that threw the exception, rather than in main. Now you can debug the actual cause of your problem.

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