2011-01-07 4 views
2

は、ここでダウンロードすることができます私のアプリでは次のとおりです。http://ge.tt/2DDqfJaiOS TableViewクラッシュはどのようにわかりません。ここでアプリ

私は議論を始めましたが、私は戻ってからレシピリストにYouTubeのビデオを見ているときに問題があり、ここでiOS TableView crash loading different data

死亡していますアプリケーションがクラッシュする...

そして別のデータソースでテーブルビューをロードする必要がある2番目のカテゴリを選択するとクラッシュします。 「EXC_BAD_ACCESS」:

これは、クラッシュログ

プログラムが信号を受信します。

(gdb) bt 
#0 0x00f0da63 in objc_msgSend() 
#1 0x04b27ca0 in ??() 
#2 0x00002665 in -[RecipesListController viewWillAppear:] (self=0x4b38a00, _cmd=0x6d81a2, animated=1 '\001') at /Users/claudiocanino/Documents/iOS/CottoMangiato/Classes/RecipesListController.m:67 
#3 0x00370c9a in -[UINavigationController _startTransition:fromViewController:toViewController:]() 
#4 0x0036b606 in -[UINavigationController _startDeferredTransitionIfNeeded]() 
#5 0x0037283e in -[UINavigationController pushViewController:transition:forceImmediate:]() 
#6 0x04f49549 in -[UINavigationControllerAccessibility(SafeCategory) pushViewController:transition:forceImmediate:]() 
#7 0x0036b4a0 in -[UINavigationController pushViewController:animated:]() 
#8 0x00003919 in -[CategoryViewController tableView:didSelectRowAtIndexPath:] (self=0x4b27ca0, _cmd=0x6d19e3, tableView=0x500c200, indexPath=0x4b2d650) at /Users/claudiocanino/Documents/iOS/CottoMangiato/Classes/CategoryViewCotroller.m:104 
#9 0x0032a794 in -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:]() 
#10 0x00320d50 in -[UITableView _userSelectRowAtPendingSelectionIndexPath:]() 
#11 0x000337f6 in __NSFireDelayedPerform() 
#12 0x00d8cfe3 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__() 
#13 0x00d8e594 in __CFRunLoopDoTimer() 
#14 0x00ceacc9 in __CFRunLoopRun() 
#15 0x00cea240 in CFRunLoopRunSpecific() 
#16 0x00cea161 in CFRunLoopRunInMode() 
#17 0x016e0268 in GSEventRunModal() 
#18 0x016e032d in GSEventRun() 
#19 0x002c342e in UIApplicationMain() 
#20 0x00001c08 in main (argc=1, argv=0xbfffef58) at /Users/claudiocanino/Documents/iOS/CottoMangiato/main.m:15 

別のBTログ:

(gdb) bt 
#0 0x00cd76a1 in __CFBasicHashDeallocate() 
#1 0x00cc2bcb in _CFRelease() 
#2 0x00002dd6 in -[RecipesListController setRecipesArray:] (self=0x6834d50, _cmd=0x4293, _value=0x4e3bc70) at /Users/claudiocanino/Documents/iOS/CottoMangiato/Classes/RecipesListController.m:16 
#3 0x00002665 in -[RecipesListController viewWillAppear:] (self=0x6834d50, _cmd=0x6d81a2, animated=1 '\001') at /Users/claudiocanino/Documents/iOS/CottoMangiato/Classes/RecipesListController.m:67 
#4 0x00370c9a in -[UINavigationController _startTransition:fromViewController:toViewController:]() 
#5 0x0036b606 in -[UINavigationController _startDeferredTransitionIfNeeded]() 
#6 0x0037283e in -[UINavigationController pushViewController:transition:forceImmediate:]() 
#7 0x091ac549 in -[UINavigationControllerAccessibility(SafeCategory) pushViewController:transition:forceImmediate:]() 
#8 0x0036b4a0 in -[UINavigationController pushViewController:animated:]() 
#9 0x00003919 in -[CategoryViewController tableView:didSelectRowAtIndexPath:] (self=0x4b12970, _cmd=0x6d19e3, tableView=0x5014400, indexPath=0x4b2bd00) at /Users/claudiocanino/Documents/iOS/CottoMangiato/Classes/CategoryViewCotroller.m:104 
#10 0x0032a794 in -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:]() 
#11 0x00320d50 in -[UITableView _userSelectRowAtPendingSelectionIndexPath:]() 
#12 0x000337f6 in __NSFireDelayedPerform() 
#13 0x00d8cfe3 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__() 
#14 0x00d8e594 in __CFRunLoopDoTimer() 
#15 0x00ceacc9 in __CFRunLoopRun() 
#16 0x00cea240 in CFRunLoopRunSpecific() 
#17 0x00cea161 in CFRunLoopRunInMode() 
#18 0x016e0268 in GSEventRunModal() 
#19 0x016e032d in GSEventRun() 
#20 0x002c342e in UIApplicationMain() 
#21 0x00001c08 in main (argc=1, argv=0xbfffef58) at /Users/claudiocanino/Documents/iOS/CottoMangiato/main.m:15 

おかげ

+0

[オリジナルの質問](http://stackoverflow.com/questions/4615321/ios-tableview-crash-loading-different-data)のアップデートとしてこれらを追加できました – Abizern

答えて

0

問題はあなたがオブジェクトを過剰にリリースしていることです。保持プロパティを使用しているので、プロパティに新しいオブジェクトを割り当てるときにオブジェクトを解放してはいけません。古いオブジェクトは自動的に解放されます。だから、これらの行は意味をなさない、それらを削除:cellForRowAtIndexPath

if (self.recipesArray != nil) { 

    // Release the arrays 
    [self.recipesArray release]; 
    [self.recipesNames release]; 
} 

RecipesListController)あなたはrowStringをリリースしています。ここでそれを行う必要はありません。その行を削除すれば、すべてが正しく動作するはずです。

+0

それは私の問題を解決しました。本当にtnx! – jollyr0ger

2

はおそらく、解放されたオブジェクトにアクセスしようとしています。 "NSZombieEnabled"を検索して、リリースの問題をデバッグする方法をお読みください。 viewwillであなたのRecipesListController.mファイルのチェック55ラインで

+0

チップのおかげで、ゾンビがより多くの情報を入手できるようにしました – jollyr0ger

0
NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path]; 

self.recipesArray = dict; 

[dict release]; 

あなたは私が //[self.recipesArrayリリース]にコメントをするときに、メモリに

を与えることはありませんオブジェクトを解放している表示されます。 //[self.recipesNames release]; それから、テーブルビュー行でクラッシュします。それを確認してください。

+0

彼らは役に立たなかった、そうです。私は学んでいると私はなぜ失っていた。 Tnx – jollyr0ger

関連する問題