我的代码:
@interface UITextView ()
- (id)styleString; // make compiler happy
@end
@interface MBTextView : UITextView
@end
#import "MBTextView.h"
@implementation MBTextView
- (id)styleString {
return [[super styleString] stringByAppendingString:@"; line-height: 1.2em"];
}
@end
我打电话给:
[MBTextView setValue:@"<b>big</b><br>blah blah" forKey:@"contentToHTMLString"];
它给了我 NSUnknownKeyException。但如果我只使用:
[UItextView setValue:@"<b>big</b><br>blah blah" forKey:@"contentToHTMLString"]; all is ok.what wrong with my code?