ストーリー ボードのタブ バー コントローラー用に UITabBarControllerDelegate を作成しようとしています…
#import <Foundation/Foundation.h>
@class CountryPickerViewController;
@interface TabBarDelegate : NSObject <UITabBarControllerDelegate>
@property (strong) CountryPickerViewController *countryPickerViewController;
- (void) tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController;
@end
Interface Builder を使用してオブジェクトを作成し、次のようにデリゲートとして割り当てました。
別のタブに切り替えると、クラッシュします。ここで何が起こっていて、どうすれば修正できますか?
EDIT:ちなみに、のメソッド実装tabBarController:didSelectViewController:
は空です(特定のロジックは含まれていません)
EDIT2:まともなスタックトレースが得られません。
そしてEXC_BAD_ACCESS
、Tab Bar Delegate
オブジェクトがゼロになる可能性があると思いますか? なぜこれが起こっているのでしょうか?
EDIT3 : NSZombies を有効にしましたが、Interface Builder で作成したオブジェクトが何らかの理由でリリースされるのが早すぎることがわかりました。これは正常ですか?
2012-08-01 12:41:11.591 MyApp[15437:707] *** -[TabBarDelegate respondsToSelector:]: message sent to deallocated instance 0x194fe0