MTRecursiveKVC 1.0.0

MTRecursiveKVC 1.0.0

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布上次发布2014年12月

Maximilian Tagher维护。



  • 作者
  • Maximilian Tagher

一个在 NSObject 上的小分类,它通过 valueForKey: 支持递归查找

NSArray *superviewChain = [view recursiveValueForKey:@"superview"]; 
// Recursively gets the superview property until it is nil 

就像传统的 valueForKey: 方法一样,当使用在集合类(NSArrayNSSetNSOrderedSet)上时,它会对集合中的每个对象应用此方法。

NSArray *allSubviews = [view recursiveValueForKey:@"subviews"]; 
// Returns all the subviews of a view, and all their subviews, and all their subviews, etc.