Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9036483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:00:43+00:00 2026-06-16T09:00:43+00:00

I am working with Facebook and Twitter for iOS6. It is working good. But

  • 0

I am working with Facebook and Twitter for iOS6.
It is working good. But when I am showing the alert view the app is crashing in both Twitter and Facebook.

Below is the code for Facebook.
If I comment this line [alert show]; it is working good.
I do not know where the mistake is.

-(IBAction)signInWithTweetPresses:(id)sender
{
    if([TWTweetComposeViewController canSendTweet])
    {

        self.view.userInteractionEnabled=NO;
        self.navigationController.navigationBar.userInteractionEnabled=NO;
        [self.spinner startAnimating];

        NSLog(@"signInWithTweetPresses called");
        ACAccountStore *store = [[ACAccountStore alloc] init];
        ACAccountType *twitterType = [store accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
        NSLog(@"store in aap delegate %@ ",store);
        NSLog(@"twittertype in aap delegate %@ ",twitterType);

        [store requestAccessToAccountsWithType:twitterType withCompletionHandler:^(BOOL granted, NSError *error) {
            if(granted) {
                // Remember that twitterType was instantiated above
                NSArray *twitterAccounts = [store accountsWithAccountType:twitterType];

                //////////////////
                if ([twitterAccounts count] > 0) {
                    // Grab the initial Twitter account to tweet from.
                    ACAccount *fbAccount = [twitterAccounts objectAtIndex:0];
                    NSLog(@"%@",fbAccount);
                    NSLog(@"accountsArray/loginWithFacebookClicked is    %@",twitterAccounts);

                    NSLog(@"username---%@\n accountDescription---%@ \n credential=====%@ \n fbAccount====%@",fbAccount.username,fbAccount.accountDescription, fbAccount.credential,fbAccount);

                    NSDictionary *tempDict = [[NSMutableDictionary alloc] initWithDictionary:[fbAccount dictionaryWithValuesForKeys:[NSArray arrayWithObject:@"properties"]]];
                    NSString *tempUserID = [[tempDict objectForKey:@"properties"] objectForKey:@"username"];
                    NSLog(@"tempUserID is  name is      %@",tempUserID);
                    self.emailStr=fbAccount.accountDescription;
                    self.nameForFacebook_String=fbAccount.username;
                    // self.fID_String=fbAccount.identifier;
                    self.fID_String = [NSString stringWithFormat:@"%@", [[fbAccount valueForKey:@"properties"] valueForKey:@"user_id"]] ;
                    NSLog(@"self.fID_String is  idd d is      %@",self.fID_String);
                    appDelegate.isForTwitterAlertBool=YES;
                    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@" " message:@"Successfully Logged in " delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil , nil];
                    [alertView show];
                }
                NSLog(@"twitter cata in aap delegate %@ ",twitterAccounts);

            }
            else{
                [self.spinner stopAnimating];
                self.view.userInteractionEnabled=YES;
                self.navigationController.navigationBar.userInteractionEnabled=YES;
            }

        }];
    }
    else
    {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"No Twitter Accounts" message:@"There are no Twitter accounts configured. You can add or create a Twitter account in Settings." delegate:nil                                                       cancelButtonTitle:@"OK"  otherButtonTitles:nil];
        [alert show];

    }

}

Code for FaceBook:

-(IBAction)loginWithFacebookClicked:(id)sender
{
    if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook])
    {
        self.view.userInteractionEnabled=NO;
        self.navigationController.navigationBar.userInteractionEnabled=NO;
        [self.spinner startAnimating];
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sharingStatus) name:ACAccountStoreDidChangeNotification object:nil];

        NSLog(@"loginWithFacebookClicked narrrrrrrrrr");
        accountStore = [[ACAccountStore alloc] init];
        // Create an account type that ensures Twitter accounts are retrieved.
        ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
            NSArray * permissions = [NSArray arrayWithObjects:@"email",@"user_location", nil];
        NSDictionary * dict=[NSDictionary dictionaryWithObjectsAndKeys:@"111718528994116",ACFacebookAppIdKey,permissions,ACFacebookPermissionsKey,ACFacebookAudienceEveryone,ACFacebookAudienceKey, nil];

        [accountStore requestAccessToAccountsWithType:accountType options:dict completion:^(BOOL granted, NSError *error) {
            if(granted ) {
                NSArray *accountsArray = [accountStore accountsWithAccountType:accountType];

                // You would ideally ask the user which account they want to tweet from, if there is more than one Twitter account present.
                if ([accountsArray count] > 0) {
                    // Grab the initial Twitter account to tweet from.
                    ACAccount *fbAccount = [accountsArray objectAtIndex:0];
                    NSLog(@"%@",fbAccount);
                    NSLog(@"accountsArray/loginWithFacebookClicked is    %@",accountsArray);

                    NSLog(@"username---%@\n accountDescription---%@ \n credential=====%@ \n fbAccount====%@",fbAccount.username,fbAccount.accountDescription, fbAccount.credential,fbAccount);

                    NSDictionary *tempDict = [[NSMutableDictionary alloc] initWithDictionary:[fbAccount dictionaryWithValuesForKeys:[NSArray arrayWithObject:@"properties"]]];
                    NSString *tempUserID = [[tempDict objectForKey:@"properties"] objectForKey:@"fullname"];
                    NSLog(@"tempUserID is  name is      %@",tempUserID);
                    self.emailStr=fbAccount.username;
                    self.nameForFacebook_String=tempUserID;
                    // self.fID_String=fbAccount.identifier;
                    self.fID_String = [NSString stringWithFormat:@"%@", [[fbAccount valueForKey:@"properties"] valueForKey:@"uid"]] ;
                    NSLog(@"self.fID_String is  idd d is      %@",self.fID_String);
                    appDelegate.isForFacebookAlertBool=YES;
                    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@" " message:@"Successfully Logged in " delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil , nil];
                    [alertView show];
                }
            }
            else
            {
                [self.spinner stopAnimating];
                self.view.userInteractionEnabled=YES;
                self.navigationController.navigationBar.userInteractionEnabled=YES;
            }
        }];

    }
    else{

        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"No Facebook Accounts" message:@"There are no Facebook accounts configured. You can add or create a Facebook account in Settings." delegate:nil                                                       cancelButtonTitle:@"OK"  otherButtonTitles:nil];
        [alert show];

    }
}

Crash Report for Facebook :CoreAnimation: warning, deleted thread with uncommitted CATransaction; set CA_DEBUG_TRANSACTIONS=1 in environment to log backtraces.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T09:00:44+00:00Added an answer on June 16, 2026 at 9:00 am

    Use the following code to display alert, it should work:

    dispatch_async(dispatch_get_main_queue(),^{
    
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@" " message:@"Successfully Logged in" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
    
    [alertView show];
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built a rails app with both facebook and twitter integration, everything was
I am working with facebook app canvas which requires post. I am using express
I'm working with a Facebook Canvas App and I would like to only display
I am working on a facebook app when i try to invoke js for
I have been struggling to send text from my app to Twitter. The code
I'm currently working on a button like the Facebook like and Twitter buttons. Since
Im using ShareKit for posting to Twitter and Facebook in my app. Facebook is
Im using ShareKit for posting to Twitter and Facebook in my app. Facebook is
i'm working with omniauth in my rails app, i have sign with facebook and
I have developed my news app and now i have to add share(facebook/twitter)option to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.