早上好! 我是很新的iPhone/iPad的编程 我的应用程序尝试了登录后更改意见登录后更改视图时崩溃的应用程序
-(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];
崩溃后崩溃(信号SIGABRT)谢谢非常!
这是怎么回事;客户*客户= [[关于我们分配] ...?你正在声明一个客户端,但分配一个AboutUs :) – Bartu 2013-04-10 18:50:04
是的,这是错误的地方,也许你应该发布你的“AboutUs”初始化事件。 – Akku 2013-04-10 18:52:41
我正在尝试与客户端分配的代码,我编辑了这个问题 – janeloulou 2013-04-10 18:54:43