2011-06-14 1 views
1

기본 IASKAppSettingsViewController의 동작을 조정하여 사용자 지정보기 (type = IASKCustomViewSpecifier)의 사용자 지정 하위 뷰 컨트롤러 (type = PSChildPaneSpecifier)를 제공 할 수 있습니다.하위 클래스 IASKAppSettingsViewController

코드에 새로운 기능을 추가하지 않고 IASKAppSettingsViewController를 하위 클래스로 만들려고했습니다.

그러나 내 자신의 하위 클래스를로드 할 때 설정 뷰는 완전히 비어 있습니다. 심지어 베어 서브 클래스의 경우에도 마찬가지입니다. 기본 IASKAppSettingsViewController로 다시 전환하면 모든 것이 예상대로 다시 작동합니다.

내 하위 클래스의 여러 위치에 중단 점을 설정해 보았습니다. 아무 것도 표시되지 않는다는 점을 제외하면 모든 것이 정상적으로 작동하는 것 같습니다.

설명서의 단서를 찾으려고했지만 그 이유를 설명하는 항목을 찾을 수 없습니다. InAppSettingsKit의 설명서에는 서브 클래 싱을 위해 설계된 것으로 명시되어 있습니다.

무엇이 여기에 있습니까? 모든 실마리는 인형을위한 작은 단계별 가이드에 감사합니다.

코드로 업데이트 :

은 역설적으로보기를 설정. 이것은 표준 IASKAppSettingsViewController와 함께 작동하지만 내 빈 파생 MyCustomSettingsViewController

- (IBAction)showInfo:(id)sender 
{  
    // Setup navigation controller for settings view 
    MyCustomSettingsViewController *settings = [[MyCustomSettingsViewController alloc] init]; 
    //IASKAppSettingsViewController *settings = [[IASKAppSettingsViewController alloc] init]; 
    settings.delegate = self; 
    settings.showDoneButton = YES; 
    UINavigationController *navigation = [[UINavigationController alloc] initWithRootViewController:settings]; 
    navigation.navigationBar.barStyle = UIBarStyleBlack; 
    [settings release]; 

    // Display the settings 
    navigation.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; 
    [self presentModalViewController:navigation animated:YES]; 
    [navigation release]; 
} 

답변

1

시도는 서브 클래스에이 방법을 추가 case "MyCustomSettingsViewController.nib"입니다. 이것은 아마도 존재하지 않습니다.

-init의 기본 구현이 -initWithNibName:nil bundle:nilnil을 호출하기 때문에 파일 이름이 기본 펜촉을 검색한다는 의미입니다.

+0

예, 기본 nib 파일을 추가하는 것을 잊었습니다. 방금 "빈"구현으로 서브 클래 싱을하면 기본 클래스로 작동하게 될 것이라고 생각했습니다. - RTFM :-) –

0

초기화 단계에서 중단 점을 설정 시도에 실패하고 있음을 추가하는 경우 하위 뷰 등/탐색 컨트롤러 밀어. 각 방법에 NSLog를 사용하면 문제를 찾을 수 있습니다. 아무 것도 작동하지 않으면 IASKAppSettingsViewController를 사용하여 데모 코드를 작성하여 코드를 보내고 문제를 다시 작성한 다음 문제를 조사합니다. 당신이 그렇게하지 않는 경우에,

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 
    return [super initWithNibName:@"IASKAppSettingsView" bundle:nibBundleOrNil]; 
} 

IASKAppSettingsViewController 차기의 기본 구현과이에, 당신의 클래스 이름의 이름을 딴 펜촉을 찾습니다 :