- (void)updateFollowButton {
if (!followButton.selected) {
[followButton setImage: [UIImage imageNamed:kFollowButtonImage] forState:UIControlStateNormal];
[followButton setImage:[UIImage imageNamed:kButtonFollowHighlighted] forState:UIControlStateHighlighted];
[followButton setBackgroundImage:[UIImage imageNamed:kFollowButtonImage] forState:UIControlStateDisabled];
} else {
[followButton setImage:[UIImage imageNamed:kUnfollowButtonImage] forState:UIControlStateNormal];
[followButton setImage:[UIImage imageNamed:kButtonfUnfollowHighlighted] forState:UIControlStateHighlighted];
[followButton setImage:[UIImage imageNamed:kUnfollowButtonImage] forState:UIControlStateDisabled];
}
}
選択状態を設定したら、updateFollowButtonを呼び出して、ボタンの通常の画像を更新し、画像を強調表示します。この単純なコードが機能しないのはなぜですか?
答えてくれてありがとう。