位置サービスと3つの(ほとんど空の)異なるビューを持つ単純なアプリケーションがあります。何らかの理由でビュー1からビュー2にアクセスできない - アプリケーションがクラッシュし、例外が発生する。ビュー1は元の.xibファイルですが、他の2つは後で追加したビューです。奇妙なのは、1> 2のようなものではなく、すべてのもの(1→3,2→1、2→3など)を切り替えることができるからです。複数のビューから切り替えることができません
私は#1ビューコントローラでこのコードを使用します。ファイル:
- (IBAction) switchToMaps : (id)sender //this is the one that doesnt work
{
MyMap *mapsView = [[MyMap alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:mapsView animated:YES];
}
- (IBAction) switchToThird : (id)sender
{
ThirdView *third = [[ThirdView alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:third animated:YES];
}
および他の例として、ここでは第二ビューコントローラ(MyMaps.m)からのコードは次のとおりです。
- (IBAction) switchBack : (id)sender
{
LastLocationViewController *firstView = [[LastLocationViewController alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:firstView animated:YES];
}
- (IBAction) switchFront : (id)sender
{
ThirdView *lastView = [[ThirdView alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:lastView animated:YES];
}
私はそれがスーパー曖昧だけど、任意のアイデアはこれを引き起こす可能性がありますでしょうか?私はこれをどのようにデバッグするのか分かりません...私はブレークポイントを各IBActionメソッドの先頭に置いても、クラッシュすると、そこにも停止しません....私はこのコードを追加する前に、 )は完全にうまくいった。
任意のアイデア?ありがとう!!