在类实例化后指定类型。初始化时尽量用instancetype代替id。
参考:
https://nshipster.com/instancetype/
[[NSArray array] mediaPlaybackAllowsAirPlay]; // 这句也会报错了
https://www.jonmsterling.com/posts/2012-02-05-typed-collections-with-self-types-in-objective-c.html
扩展:类簇(Class Clusters)、类属编程(Generic programming)|https://www.generic-programming.org/
------
[NSString string];
[NSArray array];
[UIView new];
[UIView alloc];
[[UIView alloc] init]; // 为什么只有这句报 ⚠ ‘Expression result unused’