Note that there are some explanatory texts on larger screens.

plurals
  1. POiPhone Facebook Connect logout crash after changing views
    primarykey
    data
    text
    <p>I've implemented Facebook Connect in my app just like the sample app that Facebook provides and it works well. After a user chooses to share data via Facebook they are taken to a new view and presented with the FB login dialog. When the user is done they exit the FB sharing view and return to my app's previous view. The user stays logged in as long as they don't logout - even if they exit the FB sharing view. This is good and as expected.</p> <p>I'm using the same viewDidLoad method as the sample SessionViewController.m, and this is where _session is initialized:</p> <pre><code>- (void)viewDidLoad { [_session resume]; _loginButton.style = FBLoginButtonStyleWide; } </code></pre> <p>However I noticed that if the user presses the Logout button after exiting and re-loading the FB sharing view it will throw SIGABRT or EXC_BAD_ACCESS and crash the app. The EXC_BAD_ACCESS error occurs at the [dialog show] line of the Login button's touchUpInside method:</p> <pre><code>- (void)touchUpInside { if (_session.isConnected) { [_session logout]; } else { FBLoginDialog* dialog = [[[FBLoginDialog alloc] initWithSession:_session] autorelease]; [dialog show]; } </code></pre> <p>Even though the user is connected the touchUpInside method is seeing a disconnected session... Sometimes instead of crashing after pressing the Logout button the logout will be successful but the view's status text remains "Logged in as ..." and the set status/upload image buttons are not hidden. Trying to log in again throws a SIGABRT, which looks due to a nil _session.sessionKey in FBRequest.m:344:</p> <pre><code>[_params setObject:_session.sessionKey forKey:@"session_key"]; </code></pre> <p>Is there something I should be retaining or doing differently across view changes?</p> <p><strong>EDIT:</strong> I found another user having this same issue on the Facebook Developer Forums: <a href="http://forum.developers.facebook.com/viewtopic.php?pid=193727#p193727" rel="nofollow noreferrer">http://forum.developers.facebook.com/viewtopic.php?pid=193727#p193727</a></p> <p>There is no solution posted but if I find one I'll update this question.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload