English 中文(简体)
能否核实用户是否在SOS 5号固定发送器中有一个垂直账户?
原标题:Is it possible to check if a user has a twitter account in the built-in twitter app of iOS 5?

第5号卫星具有深厚的垂直融合。 我怎么能够检查用户是否在固定的散射器中有一个账户(即他使用该账户),然后又如何使用一个<条码>的开放式URL:,以便在用户之后或事先形成一种tw?

One of the new features for developers in the iOS 5 SDK is support for the Twitter API. Apple has made it easy for developers to add Twitter support to their apps and to allow users to easily control whether or not an app has access to post to their Twitter account.

http://mashable.com/10/12/twitter-ios-5-integration/“rel=“nofollow”>,可登陆。 推特框架称之为什么?

最佳回答

为此:

- (void)tweetButtonPressed:(id)sender
{
     Class tweetComposer = NSClassFromString(@"TWTweetComposeViewController");

     if( tweetComposer != nil ) {   

         if( [TWTweetComposeViewController canSendTweet] ) {
            TWTweetComposeViewController *tweetViewController = [[TWTweetComposeViewController alloc] init];

            [tweetViewController setInitialText:@"This is a test."];  // set your initial text

            tweetViewController.completionHandler = ^(TWTweetComposeViewControllerResult result) {
                if( result == TWTweetComposeViewControllerResultDone ) 
                {
                    // user is done with composing
                } 
                else if( result == TWTweetComposeViewControllerResultCancelled ) 
                {
                    // user has cancelled composing
                }
                [self dismissViewControllerAnimated:YES completion:nil];
            };

            [self presentViewController:tweetViewController animated:YES completion:nil];
        } 
        else {
             // The user has no account setup
        }
    }   
    else {
        // no Twitter integration
    }
}
问题回答

问题第一部分......

ACAccountStore *accountStore = [[[ACAccountStore alloc] init] autorelease];
ACAccountType *twitterAccountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
NSArray *twitterAccounts = [accountStore accountsWithAccountType:twitterAccountType];

这就是我们如何在DETweetComposeViewController上重新这样做。

你们可以尝试:

BOOL didOpenTwitterApp = [UIApplication openURL:[NSURL URLWithString:@"twitter:///user?screen_name=senior"]];

如果该信能够打开官方的Twitter。

如果你只是想建立一个新的Tweet,则使用





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签