ログイン画面を使用してサーバーと通信するときにアプリを作成しようとしています。
サーバーに接続すると、ログインが正しい場合は値 true が返され、正しくない場合は false が返されます。
次に、ログインのみが正しい場合に、アプリを新しい UIViewController に切り替えるようにします (ログイン ボタンを押した後)。
そのために、サーバーが返す値を文字列に格納し、それを別の値と比較して、UIViewController スイッチを実装します。
アプリを実行した後、エラーが発生します
:Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason:
Could not load NIB in bundle: 'NSBundle </Users/dimitriskoumouras/Library/Application Support/iPhone
Simulator/6.0/Applications/9E756F03-38C1-453C-A26E-497AA7DDAECA/Administrator.app> (loaded)'
with name 'FourthViewController.xib''!!
いくつかのコードを投稿する:
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData*)data {
NSLog(@"EWYFPicOneViewController - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData*)data {");
string = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
NSLog(@" data == %@",string);
NSString *compare = [NSString stringWithFormat:@"true"];
if ( [compare isEqualToString:string]) {
UIViewController* FourthViewController = [[UIViewController alloc] initWithNibName:@"FourthViewController.xib" bundle:[NSBundle mainBundle]];
[self.view addSubview:FourthViewController.view];
}
else
NSLog(@"validation not complete");
}
何かご意見は??(私の論理全体が間違っているのではないかと思い始めました)..
前もって感謝します!!