I am using Facebook iOS SDK to do the single sign on. Now when the app first launch I have a modal view controller showing the login page with 2 buttons, login with twitter and Facebook. When I press on login the Facebook dialog box shows up.. and it says that I have authenticated the app. So I click on OK. Then it goes back to the login view controller and when dismissing it, I got this:
*** Terminating app due to uncaught exception 'NSRangeException', reason: '<MKMapView: 0x2d1720; frame = (1.2941e-09 0; 4.70638e-36 1.66881e-07); transform = [1.6714e-07, 4.70638e-36, 1.67031e-07, 4.70647e-36, 0, 0]; alpha = 0; opaque =开发者_开发百科 NO; layer = (null)> initWithCoder:: MKMapView must be initialized on the main thread.'
*** Call stack at first throw:
This does not happen if I log out from facebook first, so then I have to enter my username and password and then login. How is this possible?
U missing a line mapView = [[MKMapView alloc]init];
When it comes back to your view after facebook login put this where first your application function is called ie ViewDidLoad.
精彩评论