您能否告诉我为什么这段代码没有将文本字段中的输入文本与“admin”字符串进行比较?
if ([usertext.text isEqualToString:@"admin"]) {
if ([inputText length] <= 8) {
return [self method2];
}
return [self method];
}
编辑:实际代码
-(void)method1{
NSString *usertext=[uname text];
NSString *inputText = [typepassword text];
if ([usertext isEqualToString:@"admin"]) {
if( [inputText length] <= 8 ) {
return [self method2];
}
return [self method];
}
moviesViewController *moviesViewcont = [[moviesViewController alloc] init];
[self.navigationController pushViewController:moviesViewcont animated:YES];
}