2010-03-08 2 views
0
내 응용 프로그램은 세 개의 텍스트 필드있다

:게시 트윗

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

은 무엇 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?

답변

3

MGTwitterEngine을 사용해보아야합니다. 그것은 당신이

인증하는이 쉽게

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

입니다 필요로하는 모든 것을 제공하고 당신은 업데이 트

+2

또한 코드를 체크 아웃 할 수 있습니다를 게시 할 수

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

를 사용하는 Ben Gottlieb은 Github에서 트위터가 이동하는 새로운 OAuth 인증을 처리합니다. http://github.com/bengottlieb/Twitter-OAuth-iPhone –

관련 문제