-(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"];
//to test the values in console
NSLog(@"Value; %@", value);
NSLog(@"PWordText: %@", password.text);
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];
}
}
После этого проверьте консоль на значение, напечатанное там.