isEqualToString
はなぜ機能しませんか?はNSStringとisEqualToStringを比較します
- (void)viewDidLoad {
[super viewDidLoad];
extern NSString* globalpassword;
if ([passwo.text isEqualToString: globalpassword]) {
res = [[XMLTestViewController alloc] initWithNibName:@"XMLTestViewController" bundle:nil];
res.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self.view addSubview:res.view];
} else {
NSLog(@"faux");
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"chikos"
message:@"Wrong Password" delegate:self cancelButtonTitle:@"Cancel"
otherButtonTitles:@"OK", nil];
[alert show];
[alert release];
}
}
the result is
2011-08-11 17:56:36.543 XMLTest[6389:207] pol
2011-08-11 17:56:36.544 XMLTest[6389:207] pol
2011-08-11 17:56:36.544 XMLTest[6389:207] faux
'[passwo.text isEqualToString:globalpassword]'を実行するのではなく、なぜ 'stringWithString'で気になりますか? – deanWombourne
私はUITextと私のglobalpassordを比較しようとしますが、仕事はしません –
あなたの質問を編集し、何がうまくいかないのかについての情報を追加してください。 – deanWombourne