Reputation: 5435
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
Upvotes: 1
Views: 2324
Reputation: 331
-(void)clickfb:(id)sender {
NSHTTPCookieStorage* cookies = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (NSHTTPCookie* cookie in
[[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]) {
[cookies deleteCookie:cookie];
}
[self showLoggedOut:YES];
}
}
Upvotes: 0
Reputation: 5435
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
Upvotes: 1