【发布时间】:2016-01-14 09:19:55
【问题描述】:
我想知道为什么我的委托方法
- (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 和 LayoutManager 属性强保留在类中,但是没有调用委托方法!!!
【问题讨论】:
标签: ios objective-c layout-manager textkit