可能大家对 - (id)valueForKeyPath:(NSString *)keyPath 方法不是很了解。

 

其实这个方法非常的强大,举个例子:

NSArray *array = @[@"name", @"w", @"aa", @"jimsa"];
NSLog(@"%@", [array valueForKeyPath:@"uppercaseString"]);

输出
(
    NAME,
    W,
    AA,
    JIMSA
)
View Code

相关文章:

  • 2021-09-18
  • 2021-07-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-24
  • 2022-02-21
猜你喜欢
  • 2022-12-23
  • 2021-06-26
  • 2021-06-24
  • 2022-12-23
  • 2021-10-19
  • 2021-12-13
  • 2021-12-09
相关资源
相似解决方案