私は再帰的にビューを読み込もうとしているアプリケーションがあります。だから、同じタイプ(theViewController)の別のビューにドリルダウンできる1つのビュー(theViewController)があります。私は再帰がうまく動作し、後ろのボタンは正常に動作します。しかし、私はいくつかの仕事をし、現在のビューをアンロードする関数を実装しようとしています。私は、次のしている私のコード内の別の場所にUINavigationController - 同じviewController
:
MyAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
UINavigationController *navigationController = [delegate navigationController];
[navigationController popViewControllerAnimated:YES];
それは、そのビュー(theSecondViewController)のためのいくつかの作業を行う関数の最後でもあるが、それは別のビュー(theViewControllerをロードします)。
私の問題は、私のtheViewControllerでこのSAMEコードを使用すると壊れます。まあ、一種。私はそれが通過し、コントローラをポップすると思うが、それはそれの左(viewControlroller)をリロードしようとすると(その上に、あなたはそれについて考える)死ぬ。一度ブルームーンでは吐くます:
malloc: *** error for object 0xfb9640: double free
*** set a breakpoint in malloc_error_break to debug
しかし、通常は、それだけでエラー(少なくとも私はこのようなものが何であるかthatsのだと思う)せずに死ぬ:なぜそれがかもしれない
GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin".sharedlibrary apply-load-rules all
Attaching to process 15739.
理解する上で任意のヘルプをページを再読み込みする際に死ぬと非常に役に立ちます。
更新: ニブでエラーが発生しても問題は発生しませんでしたか?私はそれが正しいと信じています。私はコードが[navigationController popViewControllerAnimated:YES]の後にどこに行くのか分からない。次のビューのviewDidLoadに行くと思った。しかし、NSLogメッセージがあり、そのメッセージが表示されません。その中にまっすぐとはまっすぐそれが正常に動作している場合
userViewController -> theViewController -> ... -> theViewController -> theSecondViewController
:私はこれまで行うことができます
ナビゲーションはこれです。上のコードはtheSecondViewControllerで動作しますが、ViewControllerでは動作しません