我有两个 UItextFields,userNameTextField 和 passwordTextField 以及一个 UIbutton 连接。我想知道用户在 userNametextField 和 passwordTextField 中输入的内容,请问我该怎么做?感谢您的回答。
#pragma mark - User auhtentification
-(IBAction)userAuthentificate{
BOOL loginValid = YES;
BOOL passwordValid = YES; // Not specified yet
// contrioll d'interfac__ on test login et password
if (loginValid && passwordValid) {
NSString *jsonRequest = @"{\"login\":\"Samir\",\"password\":\"test\",\"mail\":\"test@gmail.com\"}";
// NSString *jsonRequest = @"{\"login\":\"Samir\",\"password\":\"test\",\"mail\":\"samir@gmail.com\",\"editor\":\"1\"}";
NSString *request_url =@"http:.../register"; // Url WS
NSURL *url = [NSURL URLWithString:request_url];
self.currentRequest = [ASIFormDataRequest requestWithURL:url];
currentRequest.delegate =self;
NSData *requestData = [NSData dataWithBytes:[jsonRequest UTF8String] length:[jsonRequest length]];
[self.currentRequest appendPostData:requestData];
[self.currentRequest setRequestMethod:@"POST"];
[self.currentRequest startSynchronous];
}
}