0
사용자 지정 드롭 다운 메뉴 (인터넷을 통해 검색된 코드)를 구현하고 두 개의 UIButton에 사용하려고합니다. 버튼을 누르면 tableView가 나타납니다. 하나의 UIButton에 대해이 메서드를 구현했으며 다른 단추에 대해이 개체를 구현하려고하지만 어떤 개체가 대리자를 호출하는지 알 수있는 방법을 모르겠습니다. 두 개의 UIButton 사용자 지정 드롭 다운 iOS
- (void)dropDownCellSelected:(NSInteger)returnIndex {
//here I've to decide which button is changed
[self.reminderCategory setTitle:[reminderCategoryList objectAtIndex:returnIndex] forState:UIControlStateNormal];
}
ViewController.m
에서 CustomDropDownView.m@protocol DropDownViewDelegate
@required
- (void)dropDownCellSelected:(NSInteger)returnIndex;
@end
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[delegate dropDownCellSelected:indexPath.row];
[self closeDropDown];
}
에서
은 어떻게 누르면 어떤 버튼을 알게 될 것입니다. 저는 방금 배우기 시작했고 대표단과 힘들어했습니다. 제발 도와주세요.