Twitter integration and iOS5: semantic and parsing issues

I was using some of Apple's example code to write the Twitter integration for my app.

However, I get a whopping amount of errors (mostly being Semantic and parse errors).

How can this be solved?

  -(IBAction)TWButton:(id)sender {
ACAccountStore *accountstore = [[ACAccountStore alloc] init];
//Make sure to retrive twitter accounts
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 iBrowser" forKey:@"status"] requestMethod:TWRequestMethodPOST];

            [postRequest setAccount:twitterAccount];

            [postRequest preformRequestWithHandeler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
                NSString *output = [NSString stringWithFormat:@"HTTP response status: %i", [urlResponse statusCode]];
                [self preformSelectorOnMainThread:@selector(displaytext:) withObject:output waitUntilDone:NO];
            }];

        }
    }];
}
 //Now lets see if we can actually tweet

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



}

Answers


The first error I see is easy to get rid of.

Objective C convention is to make the first letters of each method name lower case.

Use makeKeyAndVisible in your AppDelegate.m

The other errors we'd probably need to see where (in your code) the errors are being thrown, not just what kind of errors.


Need Your Help

Vendor:Publish - Nothing to publish for tag - Only on production server

php laravel-5 artisan

I am using a third party library and locally, I installed everything using the steps that they provided.

Font looks different in different browsers?

html css google-chrome fonts

I know there are many questions about different font rendering in different browsers.