Username and Password are not objects. Here is the code he is talking about.
- (IBAction) postTwitter: (id)sender{
TwitterRequest * t = [[TwitterRequest alloc] init];
t.username = username.text;
t.password = password.text;
[t statuses_update:tweetmessage.text delegate:self requestSelector:@selector(status_updateCallback:)];
}
Your TwitterRequest object has a username and password property, so that is fine. But username and password are not local objects to this class. What you need to do is either:
- (IBAction) postTwitter: (id)sender{
TwitterRequest * t = [[TwitterRequest alloc] init];
t.username = @"USERNAME HERE"
t.password = @"PASSWORD HERE"
[t statuses_update:tweetmessage.text delegate:self requestSelector:@selector(status_updateCallback:)];
}
OR you need to declare IBOutlets for 2 UITextField in your XIB and connect them. Like so.
Header File:
#import <UIKit/UIKit.h>
@interface TweetViewController : UIViewController {
IBOutlet UITextField *tweetmessage;
IBOutlet UITextField *username;
IBOutlet UITextField *password;
}
- (IBAction) postTwitter: (id) sender;
- (IBAction) login;
@end
If you do this you can leave your code as it.