-(void) tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
[[NSNotificationCenter defaultCenter] postNotificationName:ListOrMapAddReloadButton object:self]; //Add nearby buttons
}
ここにあるUIViewController
のはシーケンスです
viewDidload
呼ばれる[[NSNotificationCenter defaultCenter] postNotificationName:ListOrMapAddReloadButton object:self];
そして、通知設定はviewDidLoadで呼び出されるため、`の前に最初にviewDidLoadを呼び出す必要があります
-(void) tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
`
どうすればそれを達成できますか?
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(addReloadButton) name:ListOrMapAddReloadButton object:nil];
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(addNearbyButton) name:ListOrMapAddNearbyButton object:nil];