我有一个NSParagraphStyle对象,当使用NSLog检查时,它包含了列表和块,但似乎完全没有办法访问它们。 我在OS X上创建文档,并将其转移到iOS上,在文本视图中,列表和表格可以成功地重新创建,并显示在NSLog中。 然而NSParagraphStyle没有任何方法或属性来访问它们,有人能帮忙吗?D:
声明
NSArray *textLists @property(readonly, copy) NSArray *textBlocks @property(readonly, copy) NSArray *textBlocks
但是,似乎没有办法在这里访问它们。iOS 不反省,因为他们的声明不包括在UIKit中。
if ([paragraph respondsToSelector:@selector(textLists)])
NSArray* lists = [paragraph performSelector:@selector(textLists)];
if let textLists = paragraphStyle.value(forKey: "textLists") as? NSArray {
if let item = textLists.firstObject as? NSObject {
print(item.description)
}
}