CSSStyleRule.m 725 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #import "CSSStyleRule.h"
  2. @implementation CSSStyleRule
  3. @synthesize selectorText;
  4. @synthesize style;
  5. - (id)init
  6. {
  7. NSAssert(FALSE, @"Can't be init'd, use the right method, idiot");
  8. return nil;
  9. }
  10. #pragma mark - methods needed for ObjectiveC implementation
  11. - (id)initWithSelectorText:(NSString*) selector styleText:(NSString*) styleText;
  12. {
  13. self = [super init];
  14. if (self) {
  15. self.selectorText = selector;
  16. CSSStyleDeclaration* styleDeclaration = [[CSSStyleDeclaration alloc] init];
  17. styleDeclaration.cssText = styleText;
  18. self.style = styleDeclaration;
  19. }
  20. return self;
  21. }
  22. -(NSString *)description
  23. {
  24. return [NSString stringWithFormat:@"%@ : { %@ }", self.selectorText, self.style ];
  25. }
  26. @end