Twitter integration crash
I have recently finished up the twitter integration of my application and have linked the IBOutlets and actions and have included the twitter framework and the accounts framework but whenever I hit the button that is supposed to bring up the tweet composer the application crashes. Heres my code:

     -(IBAction)TWButton:(id)sender {
    ACAccountStore *accountStore = [[ACAccountStore alloc] init];
    
    ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
    
    [accountStore requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) {
        if (granted) {
            NSArray *accountsArray = [accountStore accountsWithAccountType:accountType];
            
            if ([accountsArray count] > 0) {
                ACAccount *twitterAccount = [accountsArray objectAtIndex:0];
                
                TWRequest *postRequest = [[TWRequest alloc] initWithURL:[NSURL URLWithString:@"http://api.twitter.com/1/statuses/update.json"] parameters:[NSDictionary dictionaryWithObject:@"Tweeted from iBroswer" forKey:@"status"] requestMethod:TWRequestMethodPOST];
                
                [postRequest setAccount:twitterAccount];
                
                [postRequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
                    
                    NSString *output = [NSString stringWithFormat:@"HTTP response status: %1", [urlResponse statusCode]];
                    [self performSelectorOnMainThread:@selector(displaytext) withObject:output waitUntilDone:NO];
                }];
            }
        }
    }];
}

    -(void)canTweetStatus {
    if ([TWTweetComposeViewController canSendTweet]) {
        self.TWButton.enabled = YES;
        
    } else {
        self.TWButton.enabled = NO;
    }
}










 

Twitter integration crash
===

I have recently finished up the twitter integration of my application and have linked the IBOutlets and actions and have included the twitter framework and the accounts framework but whenever I hit the button that is supposed to bring up the tweet composer the application crashes. Heres my code:

     -(IBAction)TWButton:(id)sender {
    ACAccountStore *accountStore = [[ACAccountStore alloc] init];
    
    ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
    
    [accountStore requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) {
        if (granted) {
            NSArray *accountsArray = [accountStore accountsWithAccountType:accountType];
            
            if ([accountsArray count] > 0) {
                ACAccount *twitterAccount = [accountsArray objectAtIndex:0];
                
                TWRequest *postRequest = [[TWRequest alloc] initWithURL:[NSURL URLWithString:@"http://api.twitter.com/1/statuses/update.json"] parameters:[NSDictionary dictionaryWithObject:@"Tweeted from iBroswer" forKey:@"status"] requestMethod:TWRequestMethodPOST];
                
                [postRequest setAccount:twitterAccount];
                
                [postRequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
                    
                    NSString *output = [NSString stringWithFormat:@"HTTP response status: %1", [urlResponse statusCode]];
                    [self performSelectorOnMainThread:@selector(displaytext) withObject:output waitUntilDone:NO];
                }];
            }
        }
    }];
}

    -(void)canTweetStatus {
    if ([TWTweetComposeViewController canSendTweet]) {
        self.TWButton.enabled = YES;
        
    } else {
        self.TWButton.enabled = NO;
    }
}










 
