iOS5가 포함 된 xcode에서 스토리 보드를 사용하고 있습니다. 탭이 6 개인 TabBarController가 있습니다. TabController 이전에 사용자는 A oR B 계정 유형을 선택합니다. B 유형이 선택되면 탭 중 하나를 숨기고 싶습니다.iOS5 setHidden UITabBarItem이 충돌을 일으킴
저는 UITabBarController의 하위 클래스가 있는데이 코드는 작동하지만 원하는 것은 아닙니다.
if (accountType == 2) {
[[[[self tabBar] items] objectAtIndex:1] setEnabled:NO];
}
이 내 두 번째 탭은 어둡고 확인되는 사용할 수 있습니다,하지만 난 정말이 일을하고 싶어 ...
[[[[self tabBar] items] objectAtIndex:1] setHidden:YES];
을하지만이 오류가 발생합니다 - [UITabBarItem setHidden :] : 인식 할 수없는 선택기 인해 캐치되지 않는 예외 'NSInvalidArgumentException'응용 프로그램 종료, 이유 인스턴스 0x856f490 * 전송 -
'[UITabBarItem setHidden는 :] 미정 선택기 인스턴스 0x856f490 전송' 이것을 달성하는 다른 방법이 있습니까?
나는 코드가 100 % 쓸 수는 없지만 아이디어를 얻는다는 것을 알고 있습니다. :) – Andy