ClassyKit / Classy

Expressive, flexible, and powerful stylesheets for UIView and friends.
http://classykit.github.io/Classy/
MIT License
740 stars 77 forks source link

.cas contain not exist cocoa class #107

Open minerany opened 8 years ago

minerany commented 8 years ago

if the .cas file contain the not exist class (not css dot class) , the all .cas sheet will not apply, so i think if this is the right thing.maybe we should log a warning ,not return a error and nil?

        if ([tokenValue hasPrefix:@"."]) {
            styleSelector.styleClass = [tokenValue substringFromIndex:1];
        } else {
            styleSelector.objectClass = NSClassFromString(tokenValue);
        }

        if (!styleSelector.objectClass && !shouldConcatToParent) {
            self.error = [self.lexer errorWithDescription:[NSString stringWithFormat:@"Invalid class name `%@`", tokenValue]
                                                   reason:@"Every selector must have a objectClass"
                                                     code:CASParseErrorFileContents];
            return nil;
        }
dnedrow commented 6 years ago

@minerany , what do you propose should be the expected behavior if a non-existent class is in the stylesheet?