0
我不知道爲什麼我的委託方法NSLayoutManager代表不叫
- (void)layoutManager:(NSLayoutManager *)layoutManager
didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer
atEnd:(BOOL)layoutFinishedFlag
不叫,我用這個代碼:
self.storage = [[NSTextStorage alloc] initWithString:@"sdfsdf sdf sdf sdf sdf sdf Sdf sdf sdf "];
self.layout = [[NSLayoutManager alloc] init];
[self.storage addLayoutManager:self.layout];
self.layout.delegate = self;
NSTextContainer * container = [[NSTextContainer alloc] init];
[self.layout addTextContainer:container];
TextStorage和佈局管理屬性強留在類,但委託方法不所謂!