Search code examples
iphoneobjective-cfacebookfbconnect

fbconnect logout is not working perfectly


i have integrated Fbconnect in LoginViewController.I want to logout the session from another view controller .. How i can do this ?

I tried this ..

LoginViewController *obj1 = [[LoginViewController alloc] init];     
[obj1._session logout];
[obj1._session.delegates removeObject: self];

It removing the session..But wen i go to LoginViewController the button is showing logout.But when i quit application and run it, the image is updated.

In LoginViewController i have

@interface LoginViewController : UIViewController  <FBDialogDelegate, FBSessionDelegate, FBRequestDelegate>{

    IBOutlet UITextField *txtUsername;
    IBOutlet UITextField *txtPassword;
    IBOutlet UILabel *lblMessage;
    IBOutlet FBLoginButton* _loginButton;
    FBSession* _session;

}

@property (nonatomic, retain) FBSession *_session;

and am synthesizing it @synthesize _session;

....What else i have to do ?

Somebody please help me..am very new to Iphone application and objective c


Solution

  • I got the answer ..My Friend helped me.. i want to share it...

    simply

    import "FBConnect.h"

    in ur second view controller

    then .......

    FBSession *session = [FBSession session]; [session logout];

    It works fine