Are there strongly-typed collections in Objective-C?
问题 I'm new to Mac/iPhone programming and Objective-C. In C# and Java we have "generics", collection classes whose members can only be of the type declared. For example, in C# Dictionary<int, MyCustomObject> can only contain keys that are integers and values that are of type MyCustomObject. Does a similar mechanism exist in Objective-C? 回答1: In Xcode 7, Apple has introduced 'Lightweight Generics' to Objective-C. In Objective-C, they will generate compiler warnings if there is a type mismatch.