Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NUISettings initwithStylesheet:@"mystyle"] requires NUIStyle.nss #16

Closed
raulraja opened this issue Dec 14, 2012 · 1 comment
Closed

Comments

@raulraja
Copy link

It seems like the call to the getInstance factory method initializes a stylesheet recursively calling itself and requiring NUIStyle.nss to be in the resources even if it ends up not being used.

+ (void)initWithStylesheet:(NSString *)name
{
    instance = [self getInstance];
    NUIStyleParser *parser = [[NUIStyleParser alloc] init];
    instance.settings = [parser getStylesFromFile:name];
}

+ (NUISettings*)getInstance
{
    @synchronized(self) {    
        if(instance == nil) {
            [[NUISwizzler new] swizzleAll];
            instance = [NUISettings new];
            [self initWithStylesheet:@"NUIStyle"];
        }
    }

    return instance;
}
@tombenner
Copy link
Owner

Thanks for catching this. It was an artifact from when a NUISettings+init call wasn't explicitly required, but I've fixed it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants