i use UIActionSheet to share something to faceook .
every thing is good ! but still a problem . after user login on facebook -/////// logout and share buttons show bgreat but didn't work great ! it means if user tap Logout button , login window appears again ! why ? i think , its because of FBLoginButton , when remove this method my UIActionSheet doesn't Show .
does it way to implement FBConnect without FBLoginButton ?
here is my codes :
-(IBAction)mySheet:(id)sender
{
if (session.isConnected) {
UIActionSheet *menu = [[UIActionSheet alloc] initWithTitle:@"FaceBook"
delegate:self cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles: @"Share On the Facebook" , @"Log out Facebook" ,nil];
[menu showInView:self.view];
[menu release];
} else {
UIActionSheet *menu2 = [[UIActionSheet alloc] initWithTitle:@"FaceBook"
delegate:self cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles: @"Log in Facebook" ,nil];
[menu2 showInView:self.view];
[menu2 release];
}
}
- (void)actionSheet:(UIActionSheet *)menu2 didDismissWithButtonIndex:(NSInteger)buttonIndex {
if (buttonIndex != [menu2 cancelButtonIndex])
{
FBLoginDialog* login = [[FBLoginDialog alloc] initWithSession:session];
[login show];
[login release];
}
}
- (void)actionSheet:(UIActionSheet *)menu didDismissWithButtonIndex2:(NSInteger)buttonIndex {
if (buttonIndex != [menu cancelButtonIndex])
{
[session logout];
}
}