簡體   English   中英

從Iphone App發布推文

[英]Posting Tweets from Iphone App

我的應用程序具有三個文本字段:1)用戶名

    // Initialization code
    usernameTextField = [[UITextField alloc] initWithFrame:CGRectMake(20, 5, 280, 30)];//usernameTextField released

    usernameTextField.placeholder = @"Username";
    usernameTextField.textAlignment = UITextAlignmentLeft;
    //Username text field
    usernameTextField.backgroundColor = [UIColor clearColor];
    usernameTextField.borderStyle = UITextBorderStyleRoundedRect;
    usernameTextField.autocorrectionType = UITextAutocorrectionTypeNo;
    usernameTextField.keyboardType = UIKeyboardTypeURL;
    usernameTextField.autocapitalizationType = UITextAutocapitalizationTypeNone;

2)密碼

    // Initialization code
    passwordTextField = [[UITextField alloc] initWithFrame:CGRectMake(20, 90, 280, 30)]; 
    passwordTextField.placeholder = @"Password";
    passwordTextField.textAlignment = UITextAlignmentLeft;
    //Password text field
    passwordTextField.backgroundColor = [UIColor clearColor];
    passwordTextField.borderStyle = UITextBorderStyleRoundedRect;
    passwordTextField.autocorrectionType = UITextAutocorrectionTypeNo;
    passwordTextField.keyboardType = UIKeyboardTypeURL;
    passwordTextField.autocapitalizationType = UITextAutocapitalizationTypeNone;

    passwordTextField.secureTextEntry = YES;

3)文字檢視

    textView = [[UITextView alloc] initWithFrame:CGRectMake(5, 10, 310, 180)]; 
    textView.layer.cornerRadius = 8;
    textView.clipsToBounds = YES;
    textView.font = [UIFont fontWithName:@"Arial" size:16.0f];

使用這些將推文直接上傳到Twitter的最佳/快速方法是什么,前兩個的登錄詳細信息以及Tweet為textView?

您應該研究使用MGTwitterEngine 它提供您需要的一切

身份驗證就像

MGTwitterEngine *twitterEngine = [[MGTwitterEngine alloc] initWithDelegate:self];
[twitterEngine setUsername:@"username" password:@"password"];

然后你就用

- (NSString *)sendUpdate:(NSString *)status; 

發布更新

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM