在Singleton中将值设置为父控制器时崩溃

时间:2015-02-25 12:46:25

标签: ios objective-c inheritance uiviewcontroller singleton

enter image description here

AnspruchstellerVC和VersicherungsnehmerVC继承自BaseVC。

@interface BaseVC : UIViewController

@property (nonatomic, strong) NSNumber *tag;

@end

可以为AnspruchstellerVC设置值,但对于VersicherungsnehmerVC,它不起作用。 enter image description here

- (UIViewController *)loadViewControllerByID:(NSString *)vcID
{
    NSParameterAssert(vcID);

    UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    UIViewController *vc = [mainStoryboard instantiateViewControllerWithIdentifier:vcID];
    return vc;
}

1 个答案:

答案 0 :(得分:0)

一切看起来都很好。

尝试清理项目和构建文件夹。祝你好运;)