子类化IASKAppSettingsViewController

问题描述

| 我正在尝试调整认IASKAppSettingsViewController的行为,以便它可以为自定义视图(类型= IASKCustomViewSpecifier)提供自定义子视图控制器(对于type = PSChildPanespecifier)。 我尝试对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];
}
    

解决方法

        尝试将此方法添加到您的子类中:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    return [super initWithNibName:@\"IASKAppSettingsView\" bundle:nibBundleOrNil];
}
如果您不这样做,则会启动默认实现ѭ2and,并尝试查找以您的类名称命名的笔尖,在本例中为“ MyCustomSettingsViewController.nib”。这可能不存在。 发生这种情况是因为default3ѭ的默认实现将
-initWithNibName:nil bundle:nil
nil
作为文件名意味着搜索默认的笔尖。     ,        尝试在初始化步骤上设置断点,如果要将其添加为子视图/按下导航控制器。为每种方法使用NSLogs,以便您可以查找问题。如果没有任何效果,请给我发送代码(使用IASKAppSettingsViewController创建演示代码)以解决问题,然后我将调查问题。     

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...