1

Yet another issue with the Facebook SDK. I can never get it to work as well as it does in the sample. Anyway, my session will be logged out, I turn off wifi etc. and when I hit the Log In button (FBLoginView), the app crashes straight away. Why doesn't it open up a safari page as it does in the sample, and there Safari will give the user an error saying there's no connection? Information that may help: I display the FBLoginView on a modalViewController. The button works fine when there is a connection. I get an EXC_BAD_ACCESS error when it does crash and it doesn't point anywhere useful. I've tested the samplePorject on the same device that I tested my project on, and the sample behaves as expected, ruling out the OS/Device.

Appreciate the help,
Regards,
Mike

UPDATE: Here is a picture of the crash: enter image description here It's the same crash as I had in another thread where I was getting a crash because I had set Sandboxing to 'On' in the FB developer dashboard. Why would I get the same issue when there's no internet? Feels as though this SDK is broken. Got any ideas?

Mackey18
  • 2,314
  • 2
  • 22
  • 39
  • Most logical thing to do is to check for a connection before allowing the user to click on the button. Also, always show code if you've got it. This may help you if you choose to check for connection: http://stackoverflow.com/questions/1083701/how-to-check-for-an-active-internet-connection-on-iphone-sdk?rq=1 – rog Apr 22 '13 at 17:19
  • @rog Thanks for the reply. I know I can do that. It's more a case of why isn't it working as per the sample? Is there anyway of manually starting FBLoginView, I.e. not using a tap on it, but a method call of sorts? – Mackey18 Apr 22 '13 at 17:40
  • As I mentioned earlier, you should post whatever code you're using. Without code, all possible answers are reduced to guesses. Additionally, you should give as much information as possible on the crash you're receiving. While it may appear to not point anywhere useful for you, it may make more sense to someone else. – rog Apr 22 '13 at 17:56
  • @rog Updated for you. I feel as though the SDKs error handling is wrong as I've had this same crash before. Do you know how I can check this? – Mackey18 Apr 22 '13 at 18:20
  • Apologies, I should've been more clear. I was more suggesting you post that information for future viewers of your question who may be able to help you (my experience with the FacebookSDK is very limited). In any case, you may be able to get some more information by putting your code in `@try { //CODE HERE } @catch (NSException *e) { NSLog(@"error: %@", e); }` Formatting looks silly in the comment, but hopefully you get the idea! – rog Apr 22 '13 at 19:06
  • Please post your code associated with your `FBLoginView` - is there a reason you haven't? Also, it is worth mentioning that more often than not, `EXC_BAD_ACCESS` usually indicates that something tried to access a non-existent object (i.e. it was already released). – rog Apr 22 '13 at 19:14
  • As well as posting code, also point out which sample you find works well for you. – C Abernathy Apr 23 '13 at 00:46
  • @CAbernathy I'm not really sure how posting my code will make that much of difference, the code to add the FBLoginView is simply alloc/init, then add to subview. I've copied the delegate code along with almost everything else, verbatim, from the HelloFacebookSample which works fine for me. If there's anything specific you would like me to add just ask. – Mackey18 Apr 23 '13 at 13:52

1 Answers1

0

Problem fixed in the latest Facebook SDK, 3.5.1.

Mackey18
  • 2,314
  • 2
  • 22
  • 39