なぜ私はtextfiled tovalueを比較できませんか?haw UITextFiledとNSStringを比較します。
-(void)testPass:(id)sender
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"Info.plist"];
NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path];
NSString *value;
value = [dict valueForKey:@"Password"];
if ([value isEqualToString:password.text]) {
res = [[XMLTestViewController alloc] initWithNibName:@"XMLTestViewController" bundle:nil];
res.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self.view addSubview:res.view];
}
else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"IAA"
message:@"Wrong Password" delegate:self cancelButtonTitle:@"Cancel"
otherButtonTitles:@"OK", nil];
[alert show];
[alert release];
}
}
freindは考えていません????? –