早上好!我对 iPhone/iPad 编程非常陌生 我的应用程序在登录后尝试更改视图后崩溃(信号 SIGABRT)
-(void)checkLogin {
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"LoginData" ofType:@"txt"];
NSString *myText = [NSString stringWithContentsOfFile:filePath];
//Parse lines into an NSArray;
NSArray *results= [myText componentsSeparatedByString:@"\n"];// Assumes Mac line end return
if([txtUsername.text isEqualToString: [results objectAtIndex:0]]&& [txtPassword.text isEqualToString: [results objectAtIndex:1]])
{
Clients * clients = [[Clients alloc] initWithNibName:@"clients" bundle:nil];
[self presentModalViewController:clients animated:YES];
}
else
{
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Login"
message:@"Wrong credentials"
delegate:nil
cancelButtonTitle:@"Close"
otherButtonTitles:nil];
[alert show];
}
}
@end
该应用程序在此行崩溃
[self presentModalViewController:clients animated:YES];
非常感谢!