早上好! 我是很新的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